Difference between revisions of "CSS GUIDE FONT SIZE"

From CDOT Wiki
Jump to: navigation, search
m (Usage Examples)
Line 61: Line 61:
== See Also ==
== See Also ==
<big>[http://zenit.senecac.on.ca/wiki/index.php/CSS_guide#CSS_Properties Back to CSS Index]</big>

Latest revision as of 21:51, 14 December 2006

This document is a work in progress and is subject to change.


The font-size property is used to control the size of a font for a defined section. The size can be declared absolutely or relatively to the user's default font size.

Applicability:The font-size property can be used for all CSS elements.


TARGET_ELEMENT { font-size: 12pt; }
TARGET_ELEMENT { font-size: larger }
TARGET_ELEMENT { font-size: 150% }
TARGET_ELEMENT { font-size: 1.5em }

Legal Values

Values can be entered in 4 ways:

Absolute-sizexx-small | x-small | small | medium | large | x-large | xx-large "medium" maintains the default font-size
Relative-sizelarger | smaller (Relative to parent or user font table)
LengthPositive point value12pt.
PercentagePositive percentage value150%(Relative to parent or user font table)

See usage examples section for more details.

Mozilla Recommended Values

Usage Examples

p{font-size: xx-large}  /*Set paragraph text to be very large.*/
h1{font-size: 250%}  /*Set h1 (level 1 heading) text to 2.5 times the size of the parent or user font table.*/
span{font-size: 8pt;}  /*Sets text enclosed within span tag to be standard 8pt font*/


The World Wide Web Consortium (W3C) provides a free online CSS validation service.

Specification Conformance

Browser Compatibility

See Also

Back to CSS Index