|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
hi!
what i'm tryign to do is make the border / background color of my <div> selection change on mouseover, here is my current code: Code:
<style type="text/css">
BODY{ font-family: verdana, arial, helvetica, sans-serif;
font-size: 10pt;
font-weight: bold;
background-color:#CECECE;
color:#000000;;
margin-top: 0pt;
margin-bottom: 0pt;
margin-right: 0pt;
margin-left: 0pt;}
.top{ font-family: verdana, arial, helvetica, sans-serif;
font-size: 20pt;
font-weight: bold;
background:#EEEEEE;
border: 1px dashed #000000;
height: 5%;
width: 100%;}
.top2{ font-family: verdana, arial, helvetica, sans-serif;
font-size: 20pt;
font-weight: bold;
background:#FFFFFF;
border: 1px solidd #000000;
height: 5%;
width: 100%;}
</style>
and: Code:
<div class="top">
./mikey
</div>
what i want to happen is onmouseover of the <div> select, the class changes from the "top" class to "top2" so far, i have tried the following:
i really don't want to have to have to specify style elements in the <div> selection, i want all presentation elements to be drawn from css. thank you for your time ![]() love, mikey |
|
#2
|
||||
|
||||
|
Try it like this...
Code:
<div class="top" onmouseover="this.className='top1'" onmouseout="this.className='top'">Here</div> Works for me!
__________________
Support requests via PM will be ignored! |
|
#3
|
|||
|
|||
|
To see real CSS2 in action (moz, IE5+ Mac, others), try....
Code:
div.top:hover btw it's 'solid' ![]() |
|
#4
|
||||
|
||||
|
yep, i finally got it to work, i had made a mistake in my coding and typed out this.class.name instead of this.className .
thanks for your help everybody ![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > changing css class onmouseover w/ <div> |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|