Cascading Style Sheets (CSS); Backgrounds (part 2 of 2)
By Will Bontrager
2003-10-15
Reader Rating: Here are examples for the HEAD area
<style type="text/css">
<!--
LI { background-color: yellow; }
UL { background-image: url(image.jpg);
background-repeat: no-repeat; }
OL { background-image: url(image.jpg); }
-->
</style>
And, example lists:
<ul>
<li>
<p>A list item.</p>
</li>
<li>
<p>Another list item.</p>
</li>
</ul>
<ol>
<li>
<p>A list item.</p>
</li>
<li>
<p>Another list item.</p>
</li>
</ol>
In the above lists, the list items have paragraph spacing. The area taken up with each list as a whole will contain the specified background image. The list items will have a yellow background, which covers the image wherever the list item text is printed.
Now you have a lot of tools related to using background colors and images to help you design awesome web pages.