Changes

Jump to: navigation, search

CSS GUIDE FONT SIZE

2,175 bytes added, 17:49, 14 December 2006
no edit summary
<span style="margin:0;background:#ffff33;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;">This document is a work in progress and is subject to change.</span><br /><br />
== Summary ==

The font-size property is used to control the size of a font for a defined section. The size can be declared absolutely, relatively to the user's default font size.
<table border="0">
<tr>
<td><b>Applicability:</b></td><td>The font-size property can be used for all CSS elements.<td>
</tr>
<tr>
<td><b>Inherited:</b></td><td>Yes</td>
</tr>
</table>

== Syntax ==
<pre>
TARGET_ELEMENT { font-size: 12pt; }
TARGET_ELEMENT { font-size: larger }
TARGET_ELEMENT { font-size: 150% }
TARGET_ELEMENT { font-size: 1.5em }
</pre>

== Legal Values ==
Values can be entered in 4 ways:

<table border="2">
<tr>
<th>Method</th><th>Range</th><th>Example</th>
</tr>
<tr>
<td>Absolute-size</td><td>xx-small | x-small | small | medium | large | x-large | xx-large </td><td>"medium" maintains the default font-size</td>
</tr>
<tr>
<td>Relative-size</td><td>larger | smaller </td><td>(Relative to parent or user font table)</td>
</tr>
<tr>
<td>Length</td><td>Positive point value</td><td>12pt.</td>
</tr>
<tr>
<td>Percentage</td><td>Positive percentage value</td><td>150%(Relative to parent or user font table)</td>
</tr>
</table>

See [[#Usage Examples | usage examples]] section for more details.

== Mozilla Recommended Values ==

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

== Notes ==
The [http://www.w3.org World Wide Web Consortium (W3C)] provides a free online [http://jigsaw.w3.org/css-validator/ CSS validation service].

== Specification Conformance ==
*[http://www.w3.org/TR/CSS1#font-size CSS 1 ]
*[http://www.w3.org/TR/CSS21/fonts.html#font-size-props CSS 2.1]
*[http://www.w3.org/TR/css3-fonts/#font-size-props CSS 3]

== Browser Compatibility ==

== See Also ==
1
edit

Navigation menu