Piyush Kumar
2 min readMay 23, 2021

--

El Responsive

Responsiveness In A Single Line

Key Points ๐Ÿ”ฅ:-

โ–ถ๏ธ !important must be โŒ prohibited in your line of code.

โ–ถ๏ธ Practice of using rem instead of px in CSS Files. โœ…

โ–ถ๏ธ The given Technique will almost make everything your website responsive especially the texts.

Things To Do ๐ŸŽง :-

๐Ÿ‘‰ First you should replace all the px attributes with rem.

๐Ÿ‘‰ You must have in your mind that 1rem = 16px ๐Ÿ’ช.

๐Ÿ‘‰ In the html portion of the CSS File put style โ€œfont-size: 10pxโ€.

๐Ÿ‘‰ If we write โ€œfont-size: 100%โ€ , this implies 16px.

responsive data via VSCode

๐Ÿ‘‰ So from the above figure we can conclude that in the html we can apply โ€œfont-size: 62.5%โ€ which is 10px and makes 1rem = 10px. By doing so, you have to check all the decimals part of the font size wherever you did wrote the style. For eg. โ€œfont-size: 22pxโ€, then the px converts into rem i.e., โ€œfont-size: 22remโ€, then by checking the decimal we conclude the font size as 2.2rem. It will work though. ITS FOR NORMAL WINDOW SIZE.

๐Ÿ‘‰ NOW IN 998PX DEVICES, FONT-SIZE: 55% = 8.8PX

๐Ÿ‘‰ NOW IN 768PX DEVICES, FONT-SIZE: 45% = 7.2PX

๐Ÿ‘‰ By doing the above, you can make your website fully responsive.

THANK YOU

--

--