Collected by Elizabeth Janson Home Page |
|
One of the great things about Cascading Style Sheets is that they allow you to adjust the behavior of HTML tags, giving you more control over your Web page. With a little work, you can customize tags to work the way you want them to. In the past, you pretty much had to live with the way your browser rendered each tag. For example, take a simple HTML list, like the one shown below. <UL TYPE="circle"; style="background: pink;"> <LI>List Item 1 <LI>List Item 2 </UL> When rendered by your browser, and placed inside a coloured table where cellspacing="0" and cellpadding="0", this simple HTML element has a pink background for the list items, looks like this:
You can customize the bullets used in your list.
First, there's the "list-style-type" property, which accepts the values "disc", "circle", or "square". Take a look using code for the <HEAD>
At the moment I am amused by changing the list-style-types. Consider this segment from my Pioneers home page (with the references disabled to keep this example simple).
<ul type="disc"> <li style="color: blue"><font color="#000000">Our 422 Pioneer families, <li style="color: red"><font color="#000000">Tantivy 1853. <li style="color: green"><font color="#000000">Gipsy Bride 1855 </UL> A second way to introduce colour is to place an URL reference in the TYPE instruction placed in the HEAD, or in the STYLE attribute for UL. <UL STYLE="list-style: url(redball.gif) disc"> <LI>Can I customize the bullets used in my list? <LI>Can I control the colours of each entry? </UL> Two common questions asked by beginning HTML coders are:
<UL STYLE="list-style: url(green.gif) disc"> <LI STYLE="list-style: url(../4bits/mauve.gif) disc"> Can I customize the bullets used in my list? <LI STYLE="list-style: url(orange.gif) disc"> Can I control the colours of each entry? <LI>This is a treat - a new kid game. <UL> This one worked, after I got the correct pathway to the url.
With style sheets, the answer to both is "Yes, absolutely." <STYLENow to work on our list again - notice green carries to the next LI square bullet, an example of 'inheritance'. See too, that the font color is specified - avoiding inheritance from the bullet.
The CSS Standards say A URL value can be combined with any other value:
The 'list-style' property is a shorthand notation for setting the three properties 'list-style-type', 'list-style-image' and 'list-style-position' at the same place in the style sheet.
|
Email CSS begins here |
|
This page is part of Elizabeth Janson's web site
http://www.oocities.org/elizatk/index.html
Tetbury residents in the Eighteenth Century my Australian Family History and Barrie, our Family Poet. |