Forum Moderators: not2easy
.col5{
float:left;
margin-left:28px;
}
.col5 ul{
list-style-type:none;
padding:0;
margin:0;
}
.col5 li{
background:url(images/gold.png) no-repeat 0 0;
width:125px;
height:35px;
text-align:center;
padding:10px 0 0 0;
margin:0 0 15px 0;
}
li.gold{background-image:url(images/gold.png);}/* don't really need this first one as we have already applied it above*/
li.blue{background-image:url(images/blue.png);}
li.red{background-image:url(images/red.png);}
li.yellow{background-image:url(images/yellow.png);}
li.green{background-image:url(images/green.png);}
there a better way to define several different images in a list?made me wonder if you were looking for a way to apply the images without using classes. If so - and depending on browsers/versions being supported, you may want to check out the css3 structural selectors [w3.org]. Either of nth-of-type (or maybe a combination of the *-child) should allow you to apply different images without needed to class each <li>
the use of css which may not be supported in all browsers, what's a good rule of thumb on using it? When is a brower version sufficiently old or browser itself too insignificant to be coded for?I believe coders have to decide that question for themselves.