SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    appling .class to li a ( quick question )

    hi all

    got a list ov links but i just want to apply .class to the link which is active not sure how to do this?

    my ul li is in #L1 it seems to work so i havnt applyed the styles to li's

    .css
    Code:
    ul{list-style:none;}
    #L1 a:link, #L1 a:visited {height: 20px;vertical-align: bottom;padding-top: 5px;display: block;}
    #L1 a:link, #L1 a:visited, #L1 .live a:link{border-bottom: 1px dashed #999;text-decoration: none;color: #000;}
    
    i tryd adding #L1 .live a:link with the color after but just wont wrk i also added it to the above just to keep the uniform
    
    #L1 .live a:link {color: #00F;}

    thanks!!

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,825
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    If the class is on the anchor then address it like this.
    Code:
    #L1 a.live:link {color: #00F;}
    Code:
    <p id="L1"><a class="live" href="#">test</a></p>

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes that turns blue in my editer but dosent dispaly in the browser?

    its not an anchor

    html:
    HTML Code:
    <div id="L1">
      <ul>
        <li><a href="exchange_upgrades.php">exchange upgrades</a></li>
    	<li><a href="clients.php" class="live">our clients</a></li>
    	<li><a href="gfi_products.php">gfi products</a></li>
    thanks!!

  4. #4
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my fault didnt have #L1 a.live:visited{color: #00F;} using the 1 above because the link had been visited.

    THANKS!!!!


Bookmarks

Posting Permissions

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