Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register

Go Back   WebForumz.com > Resources > Tutorials > (X)HTML & CSS
Register All Albums Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

Author


moojoo
This author has not added a author biography.

RSS Feed

Your Options
CSS Hover Effects

CSS is many times better than javascript for implementing image hover effects.

Hover the buttons below to see the effect. The first nav item is set to active with the id "current".

 

The purpose of this is to load a single image that can be used to handle all states throughout a nav menu keeping load times down and accessibility up.

The image file


The CSS


ul#navA {
padding:0;
margin:0;
list-style:none;
}
ul#navA li {
float:left;
margin:0 1px 0 0;
}
ul#navA li a {
width:200px;
height:100px;
display:block;
text-decoration:none;
background:url("button.jpg") no-repeat 0 0;
}
ul#navA li a:hover {
background:url("button.jpg") no-repeat 0 -100px;
}
ul#navA li#current a {
width:200px;
height:100px;
display:block;
text-decoration:none;
background:url("button.jpg") no-repeat 0 -200px;
}
.clearing {
height:0;
overflow:hidden;
margin:-1px 0 0 0;
clear:both;
}

The HTML


<ul id="navA">
<li id="current"><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
<div class="clearing"> </div>

Mark is a web developer for a top 10 interactive marketing agency in Dallas Texas. You can find Mark's site at: newguyinennis.com


Related Resources

Members's Comments No Comments. Be the first to comment on and rate this resource.


Search Engine Optimization by vBSEO 3.2.0 RC8