Search this Blog

Saturday 25 August 2012

Add Drop Shadows to Images and Expand them on Mouse Hover


CSS is a fun thing to play with. With the growing development of cascading style sheet and with the accepting compatibility of new browsers, web designing is becoming more and more creative. We once used Photoshop to manually add drop shadows to images but now thanks to CSS3 you can add drop shadows to all your images automatically. We will learn today how to minimize the size of large images and how can we make them expand to their original size on mouse hover. I am sure you will love it :)
Please see a demo first,



Live Demo

How To add Drop Shadows and Enlarge Images on Mouse Hover?

The methods are really simple.
  1. Go to Blogger > Design > Edit HTML
  2. Back up your template
  3. Search for ]]></b:skin>
  4. Just above ]]></b:skin> paste the following code,
.MBT-CSS3 img{
-webkit-transform:scale(0.7); /*Webkit 0.7 times the original Image size*/
-moz-transform:scale(0.7); /*Mozilla 0.7 times the original Image size*/
-o-transform:scale(0.7); /*Opera 0.7 times the original Image size*/
-webkit-transition-duration: 0.5s; /*Webkit: Animation duration*/
-moz-transition-duration: 0.5s; /*Mozilla Animation duration*/
-o-transition-duration: 0.5s; /*Opera Animation duration*/
opacity: 0.5;
margin: 0 10px 5px 0;
}
.MBT-CSS3 img:hover{
-webkit-transform:scale(1.1); /*Webkit: 0.5 times the original Image size*/
-moz-transform:scale(1.1); /*Mozilla 0.5 times the original Image size*/
-o-transform:scale(1.1); /*Opera 0.5 times the original Image size*/
box-shadow:0px 0px 30px gray;
-webkit-box-shadow:0px 0px 30px gray;
-moz-box-shadow:0px 0px 30px gray;
opacity: 1;
}

If you wish to further decrease the image size then decrease 0.7 or if you wish to further fade the image then decrease 0.5
You are almost done. Now when ever you want the image to appear with this effect, simply use this code,
<div class="MBT-CSS3">
<img src="Image URL Goes Here" />
</div>

Upload your image to Blogger editor and replace Image URL Goes Here with your image link. You are done. Now visit your blog to see the effect working in action and yell out Bravo! :P
If you wish to add this effect to another image just keep on adding <img src="Image URL Goes Here" /> before </div>
This effect is compatible with latest versions of Mozilla, Safari, Opera, Chrome and as usual not that effective with boring IE. I just hope you liked it.

14 comments:

  1. Very nice post. I just stumbled upon your blog and wished to say that I've truly enjoyed browsing your blog posts. After all I'll be subscribing to your rss feed and I hope
    you write again soon!

    Here is my page - convert virtapay

    ReplyDelete
  2. Hi, I do think this is a great website. I stumbledupon it ;) I may come back yet again since I book marked it.

    Money and freedom is the best way to change, may you be rich and continue
    to help other people.

    my homepage - best ptc

    ReplyDelete
  3. My brother suggested I may like this blog. He was once entirely right.
    This put up actually made my day. You cann't consider just how much time I had spent for this information! Thanks!

    Feel free to surf to my blog :: dragon on dragonvale

    ReplyDelete
  4. This is really interesting, You are a very skilled blogger.
    I've joined your feed and look forward to seeking more of your magnificent post. Also, I have shared your site in my social networks!

    Feel free to surf to my site ... url shortener

    ReplyDelete
  5. Very interesting points you have remarked, regards for putting
    up. "Brass bands are all very well in their place - outdoors and several miles away." by
    Sir Thomas Beecham.

    My web-site ... wallhack black ops 2

    ReplyDelete
  6. I'm not sure why but this weblog is loading very slow for me. Is anyone else having this issue or is it a issue on my end? I'll check
    back later on and see if the problem still exists.


    My web site; Watch TV Series Online

    ReplyDelete
  7. Its like you read my mind! You seem to know so much about this, like you wrote the book
    in it or something. I think that you could do with some pics to drive the message home a bit, but instead of that, this is fantastic blog.
    An excellent read. I'll definitely be back.

    Visit my blog post ... all miscrits

    ReplyDelete
  8. If some one wants expert view concerning blogging afterward i
    recommend him/her to pay a visit this webpage, Keep up the nice job.


    Look at my web page - adfly auto clicker

    ReplyDelete
  9. My relatives always say that I am killing my time here at net, except I know I am getting experience daily by reading
    thes good posts.

    Check out my site - adf.ly bot

    ReplyDelete
  10. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something.
    I think that you could do with a few pics to drive the message home a little bit, but instead of
    that, this is great blog. A great read. I'll definitely be back.

    Also visit my weblog :: minecraft 1.0

    ReplyDelete
  11. Awesome site you have here but I was wondering if you knew of any user discussion forums that cover the same topics discussed in this article?
    I'd really like to be a part of online community where I can get comments from other knowledgeable people that share the same interest. If you have any recommendations, please let me know. Many thanks!

    Also visit my weblog: sharecash downloader 2013

    ReplyDelete
  12. Hello just wanted to give you a quick heads up and let you know a few of the images aren't loading correctly. I'm
    not sure why but I think its a linking issue. I've tried it in two different web browsers and both show the same outcome.

    Visit my web site ... Free Playstation Network Codes :: ::

    ReplyDelete
  13. Hello mates, good article and fastidious urging commented here, I am actually enjoying by these.


    Also visit my web blog :: sharecash auto

    ReplyDelete
  14. I blog frequently and I really appreciate your content.
    This great article has really peaked my interest.
    I am going to take a note of your site and keep checking for new information about once a week.
    I opted in for your RSS feed as well.

    Feel free to surf to my site ... Working New Adf.ly Clicker 2013

    ReplyDelete