Results 1 to 5 of 5

Thread: divs with different hover

  1. #1
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default divs with different hover

    Hey guys,
    How can I make sure that one div has a hover:underline, and another hover: none ? The divs are stored in a separate css file.

  2. #2
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default

    I presume you mean a:hover as IE doesn't support hover of anything else.
    Unless of coarse you use some form of hack.

    If so then just set the divs with differant classes e.g.

    HTML Code:
    <div class="firstdiv">
    <a href="anywhere.html">anylink</a>
    </div>
    
    <div class="seconddiv">
    <a href="anywhere.html">anylink</a>
    </div>
    Then add some css e.g.

    .firstdiv a { text-decoration:none; }
    .firstdiv a:hover { text-decoration:underline; }

    .seconddiv a { text-decoration:none; }
    .seconddiv a:hover { text-decoration:none; }

  3. #3
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Code:
    #first_div:hover{
    text-decoration: underline;}
    
    #second_div:hover{
    text-decoration: none;}
    Isn't supported in IE6 or below, but IE7 and standards compliant browsers support it. For IE6, you would need javascript. I'm working on a script, I'll let you know when it's done.
    Last edited by alexjewell; 08-01-2007 at 04:30 PM.
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  4. #4
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You can also use an HTC to fix this for IE<7.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •