Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Design Forum > HTML / CSS
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-13-2008, 02:40 PM   #1 (permalink)
swaxmot
Junior Member
 
Join Date: May 2008
Posts: 5
Post onmouseover and out css

Hi,

is there any way to put this:
Code:
<td onmouseover="style.backgroundColor='#cccccc';" onmouseout="style.backgroundColor=''">
into a css tag or something so that i only have to type like <td class='maincolumn'> or something like it.

Thanks in avance.
swaxmot is offline   Reply With Quote
Sponsored Links
Old 05-21-2008, 10:23 PM   #2 (permalink)
iLaunch
Junior Member
 
Join Date: May 2008
Posts: 9
Default Re: onmouseover and out css

Yes. You should look into :hover. Essentially what you want to do is have a base style of:
Code:
#maincolumn { background: #FFFFFF; } #maincolumn:hover { background: #CCCCCC; }

That should do it for you.
iLaunch is offline   Reply With Quote
Old 05-22-2008, 12:25 PM   #3 (permalink)
swaxmot
Junior Member
 
Join Date: May 2008
Posts: 5
Default Re: onmouseover and out css

Tyvm, this works excellent.

EDIT: No, checked again, it doesn't work .
Still thank you for your effort.

Last edited by swaxmot : 05-22-2008 at 12:33 PM. Reason: Doesn't work
swaxmot is offline   Reply With Quote
Old 05-22-2008, 12:35 PM   #4 (permalink)
iLaunch
Junior Member
 
Join Date: May 2008
Posts: 9
Default Re: onmouseover and out css

Hmm. What issue are you having? Does the initial color set to FFFFFF but never change on mouseover?
iLaunch is offline   Reply With Quote
Old 05-22-2008, 12:37 PM   #5 (permalink)
swaxmot
Junior Member
 
Join Date: May 2008
Posts: 5
Default Re: onmouseover and out css

Quote:
Originally Posted by iLaunch
Hmm. What issue are you having? Does the initial color set to FFFFFF but never change on mouseover?
It doesn't do either of them.
swaxmot is offline   Reply With Quote
Old 05-22-2008, 03:22 PM   #6 (permalink)
iLaunch
Junior Member
 
Join Date: May 2008
Posts: 9
Default Re: onmouseover and out css

Oh whoops. I didn't notice you were using class. Try this instead:

Code:
.maincolumn { background: #FFFFFF; } .maincolumn:hover { background: #CCCCCC; }
iLaunch is offline   Reply With Quote
Old 05-22-2008, 03:27 PM   #7 (permalink)
swaxmot
Junior Member
 
Join Date: May 2008
Posts: 5
Default Re: onmouseover and out css

It works now, except for the hover .
swaxmot is offline   Reply With Quote
Old 05-22-2008, 03:39 PM   #8 (permalink)
iLaunch
Junior Member
 
Join Date: May 2008
Posts: 9
Default Re: onmouseover and out css

What browser/version are you using to test this?
iLaunch is offline   Reply With Quote
Old 05-22-2008, 03:41 PM   #9 (permalink)
swaxmot
Junior Member
 
Join Date: May 2008
Posts: 5
Default Re: onmouseover and out css

IE7 and frontpage browser
swaxmot is offline   Reply With Quote
Old 05-22-2008, 04:02 PM   #10 (permalink)
iLaunch
Junior Member
 
Join Date: May 2008
Posts: 9
Default Re: onmouseover and out css

Alright so I realize i was just being dumb, heh. Try this instead:

Code:
.maincolumn { border: 0px; background: #FF0000; } .maincolumn div { width: 100%; height: 100%; } .maincolumn div:hover { background: #CCCCCC; }

And then instead of using:

Code:
<td class='maincolumn'> whatever </td>

use

Code:
<td class="maincolumn"><div> whatever </div></td>
iLaunch is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 10:39 AM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums