Jump to content

div rollover


yoshida

Recommended Posts

Is there a way to roll over to another div once I mouse over it, or to change the background image and text color? I'm tired of creating animated buttons so I'm looking to create a manageable template.The code should work cross-browser, so on non-compliant ones as IE6 too.Thanks in advance.

Link to comment
Share on other sites

or to change the background image and text color? I'm tired of creating animated buttons so I'm looking to create a manageable template.The code should work cross-browser, so on non-compliant ones as IE6 too.Thanks in advance.

You would have to use pseudo for this to work, IE6 only supports hover on anchor tag so that should be used. Just change the image/text color on :link, :visited & :hover :)
<html><head><style type="text/css">a{width:234px;height:91px;font-size: 200%;color:white;}a:link {background-image:url('http://w3schools.invisionzone.com/style_images/w3sbanner.gif')}a:visited {background-image:url('http://w3schools.invisionzone.com/style_images/w3sbanner.gif')}a:hover {background-image:url('http://www.w3schools.com/images/w3default80.jpg');color:red}</style></head><body>  <a href="#">I am Text</a></body></html>

Link to comment
Share on other sites

SOLVED

<html><head><style type="text/css">#deflink a {	width:234px;	height:91px;	font-size: 200%;	color:white;	text-decoration:none;}#deflink a:link {background-image:url('http://w3schools.invisionzone.com/style_images/w3sbanner.gif');}#deflink a:visited {background-image:url('http://w3schools.invisionzone.com/style_images/w3sbanner.gif');}#deflink a:hover {	background-image:url('http://www.w3schools.com/images/w3default80.jpg');	color:red;}</style></head><body><div id=deflink><a href="#">I am Text</a></div></body></html>

Thanks Scott

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...