make an item in a list a different color

2 replies
  • WEB DESIGN
  • |
Span style and a separate division don't work. Both don't validate which isn't a huge problem, but both will only show up in ff or ie, not both browsers. And using a separate div really messes the page up in ie.

Not sure if it's even possible but thought I'd check here before giving up. I have a site that has just a single good money making page and I thought a little css salesmanship might help people to click on that link if they landed on another page.
#color #item #list #make
  • Profile picture of the author mojojuju
    That's easy.

    Add a different class to the special list element and style it with CSS.

    For example:

    HTML:

    <ul>
    <li>Stuff</li>
    <li>Good Stuff</li>
    <li>Really Good Stuff</li>
    <li class="special">Really Super Good Stuff</li>
    </ul>

    CSS:

    <style>
    li {color:black}
    .special {color:green}
    </style>



    Edit: I just noticed that you want to have links in that list. If so, you need to style the anchor text like this:

    HTML:

    <ul>
    <li><a href="#">Stuff</a></li>
    <li><a href="#">Good Stuff</a></li>
    <li><a href="#">Really Good Stuff</a></li>
    <li class="special"><a href="#">Really Super Good Stuff</a></li>
    </ul>

    CSS:

    <style>
    li {color:black}
    .special a {color:green}
    </style>
    Signature

    :)

    {{ DiscussionBoard.errors[1929054].message }}
  • Profile picture of the author Lloyd Buchinski
    Thank you. That sounds like it will work. Not too often I get a specific reply that completely answers the question, all in one shot. Will take a day or 2 before I get to try it out though.

    I do appreciate that.

    best wishes, lloyd
    .......__o
    .......\<,
    ....( )/ ( )...


    ???? where is potemkin village?
    Signature

    Do something spectacular; be fulfilled. Then you can be your own hero. Prem Rawat

    The KimW WSO

    {{ DiscussionBoard.errors[1929481].message }}

Trending Topics