In this post, regardless of how we load the images, I am going to show you how to light them up when there's a hover action. The first change is for making the images clickable which is just a matter of wrapping the img, or div in the case of a sprite, in an "a" element. Opacity property came in handy for the lighting effect. You can play with different opacities - 0.4 worked fine for me. The two selectors, categories_div li.categories a:hover img and .categories_div li.categories a:hover div, account for the differences in the markup:
.categories_div li.categories a:hover img, .categories_div li.categories a:hover div { opacity: 0.4; filter: alpha(opacity=40); } <div class='navdiv categories_div'> <h4>categories</h4> <ul> <li class='categories'> <a href='http://cssbakery.blogspot.com/search/label/Website%20Design' target='_blank'> <img alt='web design' src='images/redmix2.jpg' title='web design'/></a> <a href='http://cssbakery.blogspot.com/search/label/Website%20Design' target='_blank'> Website Design </a> </li> <li class='categories'> <a href='http://cssbakery.blogspot.com/search/label/CSS%20Syntax' target='_blank'> <div id='cat2'/> </a> <a href='http://cssbakery.blogspot.com/search/label/CSS%20Syntax' target='_blank'> CSS Syntax </a> </li> ......
You can test drive the new changes by hovering over the category images like the red Kitchenaid mixer in the right sidebar. They should be both clickable and also change color with hover.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.