A few days ago I was implementing Image Rollover Effect in a website Iām working on. Most of the portfolio websites are using image rollover effect. In this tutorial i will learn you how to create simple Css image rollover effect . I am using only one simple graphic. The rest is basic CSS styling, with simple HTML code.
[ad#co-1]
This Rounded border property is not supported by IE. View Demo
let us know your thoughts? If you found any other tutorials that you want to share with us,feel free to let us know by dropping in a comment.
Example:
Step #1 Css Structure
first we create a Simple Css code
[code lang="css"] *{ padding:0; margin:0;} body{ font:100% normal Arial, Helvetica, sans-serif;} [/code] [code lang="css"] .rollover_img { width: 280px; height: 150px; background-image: url(land.jpg); background-position: top; -moz-border-radius:10px; -webkit-border-radius:10px; border:10px solid #ccc; font:13px normal Arial, Helvetica, sans-serif; line-height:18px; float:left; margin:0 10px 10px 0; } [/code] [code lang="css"] .rollover_img a { color: #fff; width: 280px; height: 150px; display: block; text-decoration: none; } [/code] [code lang="css"] .rollover_img a:hover { background:#000; opacity:.60; filter:alpha(opacity=60); } [/code] [code lang="css"] .rollover_img a span { display: none; width: 280px; padding:5px; } [/code] [code lang="css"] .rollover_img a:hover span { display: block; } [/code]
Step #2 Html Structure
now we create a Simple Html code
[code lang="htmlstrict"] [/code]
View Demo
Follow us on Twitter, or subscribe to the Developers Paradise+ RSS Feed for the best web development tutorials on the web.
Really nice effect! Good tutorial!
.-= Codesquid´s last blog ..Flags of the world using only XHTML and CSS =-.
This article has been shared on favSHARE.net. Go and vote it!
.-= favSHARE´s last blog ..5 iPhone Apps Every Web Designer Should Have =-.
Pingback: 165+Need To Check Out Fresh Articles for Designers and Developers | tripwire magazine
Pingback: CSS Brigit | How To Create Simple Css Image Rollover Effect
Pingback: dot Blog. The week in links 15/02/10
cool man ,was thinking to add this,. am gonna add this now. thanks for the share :p
.-= ashwin´s last blog ..How to Download Facebook Videos? 3 ways =-.
I’m having trouble adding 2 different hyperlinks within the text that rolls over. I want to link two words 2 separate places, but the CSS seems to only allow for one link. Any suggestions? Is this possible?
How do you justify the text on hover?
Cool bro, but I need a very simple css code for hover. anyway thanks for this.
.-= gtagamer´s last blog ..GTA 4 Mega Super Jump Script Mod =-.
Thanks, very easy to understand and implement.
Really cool š Keep the good job
Great effect. This will certainly come in handy. Thankyou.
George
this is super nice..
Thanks for sharing. How would you do the same thing but using different images instead of the same one?
This looks great, adds a really nice effect to images very easily.
Thanks! nice post
Nice & easy. š Wonderful tutorial, bookmarked for implementation!
Awesome article for me, since Iām always looking for better and cleaner methods
Thank you so much for this tutorial. I have tried and tried to figure out how to make a symbol or text apear when hovering over an image. Thank you again.
Great tutorial!!
I managed to get this to work but I changed the CSS to show an image on hover. It works great on all browsers except for IE. Do you have any advice? Below is the adjusted code.
.rollover_img a:hover {
background:#000;
opacity:.60;
filter:alpha(opacity=60);
}
— to
.rollover_img a:hover {
background: url(imagefile.png) ;
}
Thanks again!!
Ed
Hi
I’m useless at this sort of thing but I almost got this working. However my text is appearing outside of the image box. I’ve uploaded the half finished website here, can anyone help? Scroll over the image of Kurt Cobain to see.
http://www.spring-creative.co.uk/ian/
Hello,
How would you adapt this for a Responsive Design site?
thanks,
Carol
Thanks for post. Very helpful and fine collection.
Thanks alot, very good article
I am regular visitor, how are you everybody? This article posted at this web site
is really nice.