div rollovers

Discussion in 'CSS' started by bscdesign.com, Jul 17, 2007.

  1. #1
    I have a set of divs with links in them that I am trying to get to rollover. I need the divs to change their border color and bg color upon rollover and change back on rolloff. They also have to be links.

    Any help is appreciated.
     
    bscdesign.com, Jul 17, 2007 IP
  2. x-noise

    x-noise Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Javascript is the only way, since IE<7 does not support hover pseudo-class applied on other elements than anchors.

    Here is a link that will probably help (it's about some things called behaviors, things that apparently correct differend IE errors)
    http://www.xs4all.nl/~peterned/csshover.html
     
    x-noise, Jul 18, 2007 IP
  3. bscdesign.com

    bscdesign.com Active Member

    Messages:
    681
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Thanks. I figured that after a while. I decided to not change the div border color and instead just fill the div with a padded rollover a tag. And it works now.
     
    bscdesign.com, Jul 18, 2007 IP
  4. Agent_Dweeb

    Agent_Dweeb Peon

    Messages:
    5,607
    Likes Received:
    384
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would like to see your site for this rollover css feature.
     
    Agent_Dweeb, Jul 18, 2007 IP
  5. bscdesign.com

    bscdesign.com Active Member

    Messages:
    681
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #5

    I just uploaded the file if anyone wants to see the rollovers I made. The rest of the page looks weird because I am getting it ready to put in my main CGI file.

    Here is the link. http://cgiwebtools.com/new/index.html

    The navigation in the top header are the rollovers.
     
    bscdesign.com, Jul 18, 2007 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    I'll second the 'behavior' .htc from PeterNed, specifically the csshover2.htc file.

    http://www.xs4all.nl/~peterned/htc/csshover2.htc

    Just slap that file into the same directory as your stylesheet, and add this to your style.css

    * html body {
    behavior:url(csshover2.htc);
    }

    In theory you could just put that into body, but why make IE7 run browser sniffing when you can filter it faster via * html.

    Real nice is it also implements :focus
     
    deathshadow, Jul 20, 2007 IP