22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The following example causes a ’3em’ text indent.<br />

P { text-indent: 3em }<br />

16.2 Alignment: the ’text-align’ property<br />

’text-align’<br />

Value: left | right | center | justify | | inherit<br />

Initial: depends on user agent and writing direction<br />

Applies to: block-<strong>level</strong> elements<br />

Inherited: yes<br />

Percentages: N/A<br />

Media: visual<br />

This property describes how inline content of a block is aligned. Values have<br />

the following meanings:<br />

left, right, center, and justify<br />

Left, right, center, and double justify text, respectively.<br />

<br />

Specifies a string on which cells in a table column will align (see the section<br />

on horizontal alignment in a column [p. 260] for details and an example).<br />

This value applies only to table [p. 245] cells. If set on other elements, it will<br />

be treated as ’left’ or ’right’, depending on whether ’direction’ is ’ltr’, or ’rtl’,<br />

respectively.<br />

A block of text is a stack of line boxes [p. 105] . In the case of ’left’, ’right’ and<br />

’center’, this property specifies how the inline boxes within each line box align<br />

with respect to the line box’s left and right sides; alignment is not with respect to<br />

the viewport [p. 96] . In the case of ’justify’, the UA may stretch the inline boxes in<br />

addition to adjusting their positions. (See also ’letter-spacing’ and<br />

’word-spacing’.)<br />

Example(s):<br />

In this example, note that since ’text-align’ is inherited, all block-<strong>level</strong> elements<br />

inside the DIV element with ’class=center’ will have their inline content centered.<br />

DIV.center { text-align: center }<br />

Note. The actual justification algorithm used is user-agent and written<br />

language dependent.<br />

Conforming user agents [p. 32] may interpret the value ’justify’ as ’left’ or ’right’,<br />

depending on whether the element’s default writing direction is left-to-right or<br />

right-to-left, respectively.<br />

16.3 Decoration<br />

238

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!