PDA

View Full Version : Div hover



CaptainB
Sep 2nd, 2007, 03:55 PM
Hi!

How come that the text in my div class called "button" won't hover, when I mouse my mouse over it? Here's the CSS:


.button { height:22px;
background-image:url(images/btn.png);
text-align:center;
float:left;
color:#fff;
font-weight:bold;
margin-left:15px;
line-height:20px;
padding-right:3px;
padding-left:3px;
cursor:default;
}

.button:hover { color:#FF6600;
}

BarrMan
Sep 2nd, 2007, 04:00 PM
You should use javascript for that. CSS can only do this with links.

Jutlander
Sep 2nd, 2007, 04:45 PM
Wrong. The :hover pseudo class can be used on many selectors, but IE will not recognize it. Only on links. Try out the above code in Firefox... it works.

CaptainB
Sep 2nd, 2007, 04:51 PM
It's funny, I just returned to tell you that it works in FF and then I saw your answear :)
Okay, strange. Then the only way of doing it in IE is with javascript?