Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to highlight a <div> using mouseover

Status
Not open for further replies.

guestAsh

Technical User
Feb 27, 2004
65
GB
hi,

is it possible to highlight a <div> much like higlighting a <a>Tag using CSS?

for example:
<div>Some text here</div>

would be highlighted when hovered over by a mouse.

thanks

Ash
 
Code:
div {
  background: red;
}

div:hover {
  background: blue;
}
This won't work in IE6. I don't know about IE7, I do believe they promised they will fix it. If this does not work, you will have to either add onmouseover and onmouseout events for JS solution or dynamically append different class on hover.
 
Thanks Vragabond,

looks like i'm going down the Javascript route.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top