{"id":21545,"date":"2013-05-06T08:21:57","date_gmt":"2013-05-06T15:21:57","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=21545"},"modified":"2015-05-20T12:16:23","modified_gmt":"2015-05-20T19:16:23","slug":"font-size","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/f\/font-size\/","title":{"rendered":"font-size"},"content":{"rendered":"

The font-size<\/code> property specifies the size, or height, of the font. font-size<\/code> affects not only the font to which it is applied, but is also used to compute the value of em, rem, and ex length units.<\/p>\n

p {\r\n  font-size: 20px;\r\n}<\/code><\/pre>\n

font-size<\/code> can accept keywords, length units, or percentages as values. It\u2019s important to note however that when it\u2019s declared as part of the font<\/a><\/code> shorthand property, font-size<\/code> is a mandatory value. If it is not included in the shorthand, the entire line is ignored.<\/p>\n

Length values<\/a> (e.g. px, em, rem, ex, etc) which are applied to font-size<\/code> cannot be negative.<\/p>\n

Absolute keywords and values<\/h3>\n
.element {\r\n  font-size: small;\r\n}<\/code><\/pre>\n

It accepts the following absolute keyword values:<\/p>\n