CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2003, 12:15 AM
mikeylove's Avatar
mikeylove mikeylove is offline
doesn't like the cereal.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: michigan
Posts: 121 mikeylove User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 31 sec
Reputation Power: 6
Send a message via AIM to mikeylove
Question changing css class onmouseover w/ <div>

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:
  • renaming the top2 class to top:hover
  • using:
    Code:
    <div onmouseover="this.class.name='top2'" onmouseout="this.class.name='top'">

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
__________________
Hey, i can edit my signature again.

Hello.

visit http://connectyourweb.com/

Reply With Quote
  #2  
Old October 24th, 2003, 02:48 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Jul 2003
Location: I used to live at home, now I stay at the house
Posts: 9,920 ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)ChiefWigs1982 User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 3 Months 2 Weeks 6 Days 7 h 15 m 40 sec
Reputation Power: 873
Facebook
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!
Sites: Route of Queue | Sinthetic - Alternative UK Hiphop
Read These: The General Rules Thread | The General FAQ Thread | NEW USERS - How to post a question

Sign up with Matched.co.uk and earn up to £15 per website every month!


Reply With Quote
  #3  
Old October 24th, 2003, 04:10 AM
mrrichardfeder mrrichardfeder is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2001
Posts: 765 mrrichardfeder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 45 sec
Reputation Power: 8
To see real CSS2 in action (moz, IE5+ Mac, others), try....
Code:
div.top:hover

btw it's 'solid'

Reply With Quote
  #4  
Old October 24th, 2003, 01:46 PM
mikeylove's Avatar
mikeylove mikeylove is offline
doesn't like the cereal.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: michigan
Posts: 121 mikeylove User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 31 sec
Reputation Power: 6
Send a message via AIM to mikeylove
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > changing css class onmouseover w/ <div>


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT