Changes

Jump to: navigation, search

CSS GUIDE TEXT ALIGN

2,368 bytes added, 21:23, 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 text-align property is used to to describe how contents of a block are horizontally aligned.
<table border="0">
<tr>
<td><b>Applicability:</b></td><td>The text-align property can be used for all CSS elements.<td>
</tr>
<tr>
<td><b>[http://developer.mozilla.org/en/docs/CSS:%40media#Media_groups Media Group:]</b>
</td><td>Visual</td>
</tr>
<tr>
<td><b>Inherited:</b></td><td>Yes</td>
</tr>
</table>

== Syntax ==
<pre>
TARGET_ELEMENT { text-align: start | end | left | right | center | justify | <string> }
</pre>

== Legal Values ==
There are 7 possible values for text-align:

<table border="2">
<tr>
<th>Value</th><th>Explanation</th>
</tr>
<tr>
<td>start</td><td>Contents are aligned to the start edge of the line box.</td>
</tr>
<tr>
<td>end</td><td>Contents are aligned to the end edge of the line box.</td>
</tr>
<tr>
<td>left</td><td>Contents are aligned to the left edge of the line box.</td>
</tr>
<tr>
<td>right</td><td>Contents are aligned to the right edge of the line box.</td>
</tr>
<tr>
<td>center</td><td>Contents are centered within the line box.</td>
</tr>
<tr>
<td>justify</td><td>Text is justified according to the method specified by the 'text-justify' property.
</td>
</tr>
<tr>
<td><string></td><td>When applied to a table cell, specifies a string on which all cells in its table column that also have a string value for 'text-align' will align.</td>
</tr>
</table>

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

== Mozilla Recommended Values ==

== Usage Examples ==
<pre>center { text-align: center } Creates center element that will align contents in center of line box</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#text-align CSS 1 ]
*[http://www.w3.org/TR/CSS21/text.html#alignment-prop CSS 2.1]
*[http://www.w3.org/TR/css3-text/#text-align CSS 3]

== Browser Compatibility ==

== See Also ==

<big>[http://zenit.senecac.on.ca/wiki/index.php/CSS_guide#CSS_Properties Back to CSS Index]</big>
1
edit

Navigation menu