SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Indiana
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Nested "classes" ?

    I am trying to get all my text links to have the same attributes of one class, but at the same time I want one of the links to have different a:active and a:hover colors. When I try to have nested a <a class="bla..> within a <div class="bla..> Netscape only applies the outer class. What can I do?

    Here is my page:
    http://www.home.earthlink.net/~svoltmer/

    It is the links to the left with the home link being the nested one.

  2. #2
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've got:
    Code:
    a:link.home { ... }
    It should be:
    Code:
    a.home:link { ... }

    As in...

    CSS:
    Code:
    #menu a:link, #menu a:visited {
    /* your default menu link style here */
    }
    
    #menu a:hover, #menu a:active {
    /* your default menu link style here */
    }
    
    
    a.special:hover, a.special:active {
    /* your specific link style here */
    }


    X/HTML:
    Code:
    <div id="menu">
      <a href="link1.html">Link1</a>
      <a href="link2.html">Link2</a>
      <a href="link3.html" class="special">Link3</a>
      <a href="link4.html">Link4</a>
    </div>
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Indiana
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, that fixes it for one browser, but I still get different results between IE6 and NS7. (the a.home:link is supposed to be blue not white)

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

    You haven't defined a visited class for your Home link, so if you've clicked on it it will default to the white of your exiting visited class.

    This may be your problem


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
  •