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 background of the box generated by the root element covers the entire<br />

canvas [p. 26] .<br />

For HTML documents, however, we recommend that authors specify the background<br />

for the BODY element rather than the HTML element. User agents should<br />

observe the following precedence rules to fill in the background: if the value of<br />

the ’background’ property for the HTML element is different from ’transparent’<br />

then use it, else use the value of the ’background’ property for the BODY<br />

element. If the resulting value is ’transparent’, the rendering is undefined.<br />

According to these rules, the canvas underlying the following HTML document<br />

will have a "marble" background:<br />

<br />

<br />

<br />

Setting the canvas background<br />

<br />

BODY { background: url("http://style.com/marble.png") }<br />

<br />

<br />

<br />

My background is marble.<br />

<br />

<br />

14.2.1 Background properties: ’background-color’,<br />

’background-image’, ’background-repeat’, ’background-attachment’,<br />

’background-position’, and ’background’<br />

’background-color’<br />

Value: | transparent | inherit<br />

Initial: transparent<br />

Applies to: all elements<br />

Inherited: no<br />

Percentages: N/A<br />

Media: visual<br />

This property sets the background color of an element, either a value<br />

or the keyword ’transparent’, to make the underlying colors shine through.<br />

Example(s):<br />

H1 { background-color: #F00 }<br />

’background-image’<br />

Value: | none | inherit<br />

Initial: none<br />

Applies to: all elements<br />

Inherited: no<br />

Percentages: N/A<br />

Media: visual<br />

188

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

Saved successfully!

Ooh no, something went wrong!