0
Size in CSS (px, em, vh, vw, %)
I have only ever used pixels but after seeing the questions posted by others, now I am wondering if pixels is outdated? Is one superior to the rest or are there different advantages to each?
5 Réponses
+ 1
in CSS PIXELS are used for initial size, and em is used in comparison of pixels. like if text is 50px and next text you want is 25px then you can use 0.5em. there are viewports vh , vw , vmin and vmax. viewport height and viewport width.
+ 3
For font-size, em is a better choice for responsive design
https://code.sololearn.com/WrgbrFC038ma/?ref=app
https://code.sololearn.com/W3gS00IGw160/?ref=app
0
Correct me if I am wrong. Em would be great for scaling text, pixel is good for small things like lines and viewport is good for page construction? Am I close?
0
Is there any reason not to use pixels?
0
For displaying appropriately for different screen size