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.

. We recommend a computed value for ’normal’ between 1.0 to<br />

1.2.<br />

<br />

The box height is set to this length. Negative values are illegal.<br />

<br />

The computed value [p. 70] of the property is this number multiplied by the<br />

element’s font size. Negative values are illegal. However, the number, not<br />

the computed value [p. 70] , is inherited.<br />

<br />

The computed value [p. 70] of the property is this percentage multiplied by<br />

the element’s computed font size. Negative values are illegal.<br />

Example(s):<br />

The three rules in the example below have the same resultant line height:<br />

DIV { line-height: 1.2; font-size: 10pt } /* number */<br />

DIV { line-height: 1.2em; font-size: 10pt } /* length */<br />

DIV { line-height: 120%; font-size: 10pt } /* percentage */<br />

When an element contains text that is rendered in more than one font, user<br />

agents should determine the ’line-height’ value according to the largest font size.<br />

Generally, when there is only one value of ’line-height’ for all inline boxes in a<br />

paragraph (and no tall images), the above will ensure that baselines of successive<br />

lines are exactly ’line-height’ apart. This is important when columns of text in<br />

different fonts have to be aligned, for example in a table.<br />

Note that replaced elements have a ’font-size’ and a ’line-height’ property,<br />

even if they are not used directly to determine the height of the box. The<br />

’font-size’ is, however, used to define the ’em’ and ’ex’ units, and the ’line-height’<br />

has a role in the ’vertical-align’ property.<br />

’vertical-align’<br />

Value: baseline | sub | super | top | text-top | middle | bottom |<br />

text-bottom | | | inherit<br />

Initial: baseline<br />

Applies to: inline-<strong>level</strong> and ’table-cell’ elements<br />

Inherited: no<br />

Percentages: refer to the ’line-height’ of the element itself<br />

Media: visual<br />

This property affects the vertical positioning inside a line box of the boxes<br />

generated by an inline-<strong>level</strong> element. The following values only have meaning<br />

with respect to a parent inline-<strong>level</strong> element, or to a parent block-<strong>level</strong> element, if<br />

that element generates anonymous inline boxes [p. 98] ; they have no effect if no<br />

such parent exists.<br />

Note. Values of this property have slightly different meanings in the context of<br />

tables. Please consult the section on table height algorithms [p. 258] for details.<br />

baseline<br />

Align the baseline of the box with the baseline of the parent box. If the box<br />

doesn’t have a baseline, align the bottom of the box with the parent’s baseline.<br />

143

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

Saved successfully!

Ooh no, something went wrong!