Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-18-2002, 12:32 PM   PM User | #1
stevan
Regular Coder

 
Join Date: Jun 2002
Posts: 268
Thanks: 4
Thanked 0 Times in 0 Posts
stevan is an unknown quantity at this point
mouse over

i am looking for a script to do a mouse over to change the color of the background and text color in the same cells


Thxs Steve
stevan is offline   Reply With Quote
Old 06-18-2002, 01:12 PM   PM User | #2
meerkat
New Coder

 
Join Date: Jun 2002
Location: Glasgow, Scotland
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
meerkat is an unknown quantity at this point
Stevan

You could do this quite simply using CSS and the 'a' tag.

#button a {color: white; background-color: red;}
#button a:hover {color: red; background-color: yellow;}


Then you call them up using the div tag:

<div id="button"><a href="#">blah</a></div>

This should work ok

meerkat
__________________
Ya don't need a weatherman to know
which way the wind blows...
meerkat is offline   Reply With Quote
Old 06-18-2002, 02:50 PM   PM User | #3
QuackHead
Regular Coder

 
Join Date: Jun 2002
Posts: 344
Thanks: 0
Thanked 0 Times in 0 Posts
QuackHead is an unknown quantity at this point
Are you looking to change the background and text colour when you mouse over a link? Or when you mouse over the cell.

The code meerkat gave you will only change something when the user rolls their mouse over a link inside the <div>

~Quack
QuackHead is offline   Reply With Quote
Old 06-18-2002, 02:50 PM   PM User | #4
Zvona
Regular Coder

 
Join Date: May 2002
Location: Helsinki, Finland
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Zvona is an unknown quantity at this point
Exclamation

Whenever you're looking for scripts, you should post to forums about scripting problems. Here, we handle and discuss about problems related to mark-up, document structures and style definitions.

In this particular case you were successful: hovering is done with CSS just like stevan advised.
Note, that NN4 don't support pseudo-classes, thus hovering isn't working.
__________________
Zvona
First Aid for
Web Design
Zvona is offline   Reply With Quote
Old 06-18-2002, 05:43 PM   PM User | #5
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Quote:
Originally posted by QuackHead
The code meerkat gave you will only change something when the user rolls their mouse over a link inside the <div>
Though if everyone finally realized how horrible IE is, we can all go like:

div:hover {
background: bla;
}

Because Gecko, Opera, and I'm pretty sure Konqueror all support the :hover pseudo-class on elements other than <a>.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:36 PM.


Advertisement
Log in to turn off these ads.