<UL> <LI> List Questions

Discussion in 'CSS' started by Blonde Jon, May 24, 2009.

  1. #1
    I'm sure there is a simple answer to my question, but I have a list and I want the last item on the list to be colored orange. How do I do that without making the entire list orange?

    I want where it reads overall value to show up orange.


    Also, I have a numbered list for my navigation. It looks great in FireFox, but it only shows ones in IE. Here's the CSS for the numbered list:

    #listservices li {
    list-style-type:decimal;
    height:17px;
    margin:5px 0;
    margin-left:10px;
    font-size:1.2em;
    padding:2px 0 0 20px;

    }

    You can see what I'm working on here:

    http://nerdysetups.com/manny/muscle_gain_truths.html
     
    Blonde Jon, May 24, 2009 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    For the color change, add a class or ID name to the list item, and style it orange.
    <ul>
      <li>text</li>
      <li  class="last">text</li>
    </ul>
    ===========
    li.last {
      color: orange;
      }
    Code (markup):
    On the other, that should be an <ol>, ordered list. You coded it as <ul>. But that's not the problem, here. IE screws up the count when the <li>s have layout. In the case, the hasLayout is triggered by the {height: 17px;}. Remove the height property from the ruleset. IE8 does not have hasLayout, and the height doesn't cause problems there.

    cheers,

    gary
     
    kk5st, May 24, 2009 IP
    Blonde Jon likes this.
  3. Blonde Jon

    Blonde Jon Active Member Affiliate Manager

    Messages:
    745
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Your a genius! Thanks! :)
     
    Blonde Jon, May 24, 2009 IP