+ 10
While designing with CSS, is it better to use px or the size in words... e.g.. font-size: large OR font-size: 20px?
I actually want to know the safest to use since my code will be displayed on different browsers and different devices.
5 odpowiedzi
+ 9
I feel better😙
+ 9
Noted. Thanks man John Nehry C. Dedoro
+ 3
I think you should use font-size:20px or 20% ..large doesn't specify the size..is 100% large or 20% large...so the px and % should be the best
+ 2
you can use rem or em units in Css if you want the fonts resizable , the font will be depend on the parent font size.
+ 2
I was just going over my profile and came across this question I asked when I was new to css. I'm really glorified to say I can answer this question better now without much stress...
Px is for pixels obviously, but with my my experience now, I wouldn't advice this unit when sizing boxes in CSS.
% has and advantage of "fluidity" & "adaptivity" of box elements... This fluidity makes the box resizable and somewhat responsive whenever you adjust the screen size of the browser.
Although, you can always use @media to make your styling responsive using px. But all round I prefer %.
No reference is this post... just what I discovered over the month of constant learning.