CSS Font-size Property

Reference on the CSS Font-size Property. Includes useful Example of how its used.

The CSS font-size property is used to control the size of text.

Setting the font-size on containing elements, such as the body element, or a div element, will make the child elements inherit the font-size from the parent.

Possible Values

Read Units of Measurement to understand the values. It is recommended to use EM or Percentages when setting the font-size. Example:

p {
  /* Using Ems */
  font-size: 1em;
  /* Using Percentages */
  font-size: 100%;
  /* Using Pixels */
  font-size: 18px;
}

Note: Generally you can use any unit of measurement, just keep in mind, that some units are better suited for print-media.

Inherited? - YES!

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.