Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts

    make 1 list item different

    i have css for a list


    #links ul
    {

    display: inline;
    list-style-type: none;

    margin-top:0px;
    margin-bottom:0px;
    padding:0px;
    direction:rtl;
    float:right;
    width:655px;
    }


    #links ul li
    {
    border:#494949 solid 1px;
    float:right;
    list-style-type: none;
    dir:rtl;
    margin-top:2px;
    margin-bottom:0px;

    text-align:center;
    padding-top:2px;
    padding-bottom:2px;
    width:90.5px;

    }

    #links ul li a
    {
    color:#9c9c9c;
    text-decoration:none;
    font-size:13px;

    }


    I would like to make the current page <li> a different style - a different background color and font color - what's the best way to do this.
    do i have to make the li for that link have an id - and then how do I access just that id of the li to make it a different style

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    I would like to make the current page <li> a different style - a different background color and font color - what's the best way to do this.
    Take a look at http://www.codingforums.com/showpost...64&postcount=3
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts
    ok i did

    <li id=ac>


    and then


    #links #ac li
    {
    background-color:#9c9c9c;

    }

    why didn't this work ? what am I doing wrong?

  • #4
    New Coder
    Join Date
    Nov 2006
    Location
    Bristol, UK
    Posts
    85
    Thanks
    6
    Thanked 6 Times in 6 Posts
    Try:

    #links li#ac

    instead.
    Never argue with an idiot... they'll bring you down to their level and beat you with experience...

  • #5
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts
    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •