:hover not working, help please
hi all,
Ok, originally I used
.row2:hover { background-color: #CCCCCC; }
to make the row in my table change color. Then I realized it was a bad thing since it is site wide and messes up some other stuff. So, I wanted to use an inline style to apply it to only 1 specific table. I can't seem to get it to work.
That changes the row to gray permanently but I can't figure out how to get hover to work here. Any suggestions?
Thanks
----------------------------
[Links Removed]
kazimmerman posted this at 06:32 — 23rd December 2008.
He has: 698 posts
Joined: Jul 2005
I don't think that's possible with inline CSS, but you could use JavaScript to do it, using the onmouseover event, doing something like this:
...
<tr onmouseover="this.style.background=COLOR" >
...
Kurtis
greg posted this at 07:11 — 23rd December 2008.
He has: 1,581 posts
Joined: Nov 2005
Hi, welcome to the forums
I've removed the links from your posts as we don't allow self promoting links in posts, but you can use your signature for that.
You could create a unique class in your CSS stylesheet for this specific requirement. A new unique name specifically only for this row, and then call the new class in your
<tr>
.webwiz posted this at 19:01 — 23rd December 2008.
He has: 629 posts
Joined: May 2007
You can't apply a ":hover" style inline, as kazimmerman says. You can do it in the CSS, except for the fact that IE 6 only applies ":hover" on links ('A' tags with href). The code you give should work in other browsers, though.
There are scripting solutions for this failure in IE 6. I use whatever.hover from Peter Nederlof.
If you still can't get your code to work on your web page, put a sample page on a server somewhere so we can look at it. Otherwise we are just guessing.
Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.