Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Website CSS and Font Sizes - Best Practices

In my website CSS, I'm using EM, PX, PT and Percentages to set the font sizes.

I am also using JQuery UI which uses EM.

I have now come to the point where I need to resize all the font sizes to slightly smaller.

All in all, what's the best what of bringing all the font sizes down a bit and should I be changing how I'm doing font sizes to whichever way?

Everyone seems to have a different opinion on this topic.

like image 794
Satch3000 Avatar asked Apr 19 '11 09:04

Satch3000


1 Answers

As per my understanding. What you must do is something like that:

body{font-size:11px;} This will make 1em = 11px

Now everywhere you'll set the font-size in em like:

a{font-size:1em;} and follow the same way to all the elements like h1{font-size:2em;}

Now if you need to increase decrease font size just set the font size in body like:

body{font-size:13px;} etc.

Hope that helps

like image 120
Naveed Ahmad Avatar answered Oct 11 '22 06:10

Naveed Ahmad