How to set the font size using CSS

First reset 1em to 10px for the whole page.

body {
	font-size: 62.5%; /* Resets 1em to 10px */
}

Finally, set the font size for a section, such as the content.

#content {
	font-size: 1.6em;
	line-height: 1.6em;
}

1.6em is equal to 16px.

The line-height is the distance between lines.

Related

This entry was posted in Blog Tips and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>