|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
help with mouseover bg color change
I know how to make the background of a link change but how do you do it if it isnt a link? in css...
|
|
#2
|
||||
|
||||
|
with the :hover property, you can use it on any element
it doesn't have to be a link p:hover { background:#eee; } this works in standard compliance browsers. |
|
#3
|
|||
|
|||
|
Thanks, one more thing..
What would you put in your <div> to make that p:hover show up? Thanks! |
|
#4
|
||||
|
||||
|
the style i provied should work on any paragraph in the document.
<p> Some text </p> and as i said this only work in standard compliance browsers, like mozilla,opera and khtml-browsers. so you won't see the effect in msie. |
|
#5
|
|||
|
|||
|
bluffing
How about bullying ie into displaying the rollover by setting up a style for the unbutton and attaching it to a null link (scripting out the underline and change in cursor of course...)
so... Code:
in the head:
<style type="text/css">
.unbutton {color:#666666;}
a.unbutton:link, a.unbutton:visited {
cursor:default; text-decoration:none;}
a.unbutton:hover {
background-color:#cccccc; cursor:default; text-decoration:none;}
</style>
in the body:
<a href="javascript:;" class="unbutton">
this isn't a link you know</a>
Alternatively you could use the javascript Code:
onMouseOver="this.style.background='#cccccc'" onMouseOut="this.style.background='#ffffff'" to alter the bg colour of your div That any help? |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > help with mouseover bg color change |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|