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,
How To add Drop Shadows and Enlarge Images on Mouse Hover?
The methods are really simple.
- Go to Blogger > Design > Edit HTML
- Back up your template
- Search for ]]></b:skin>
- 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.
If you don't want to get yourself into Serious Technical Trouble while editing your Blog Template then just sit back and relax and let us do the Job for you at a fairly reasonable cost. Submit your order details by Clicking Here »
Gosh, CSS is always impressing me ;o
ReplyDeleteAwesome
ReplyDeleteI will definitely going to use this in my new Blog.
o my god
ReplyDeleteare you paid by my teachers to make me mad?????
i don't know that it is so easier oh my god i can't believe it.
no scripts???????????
when i read this article in my mobile(no electricity)i can't myself to see the demo and when light come
i use it and apply to my blog.........
happy now
i want to download your cute box template please send me a link
ReplyDelete@ajani kumar soni
ReplyDeleteHere is the link to Cute Box Template :)
http://www.mybloggertricks.com/2009/12/releasing-two-column-blogger-template.html
Samsexy98
I am really glad to know you all liked it. :)
ReplyDelete@Anjani
Thanks pal for all the love. Could you kindly email me your ID so that I could send you a copy.
@Sam
Thanks for helping other readers. :)
my email is anjanisoni123@gmail.com
ReplyDelete@ sam
ReplyDeletethanks sam
@Anjani
ReplyDeleteTemplate sent! Check your inbox please :a
Here is a back to top script that will get larger on hover for your blog as a gift for your awesome tutorials:
ReplyDeletehttps://sites.google.com/site/anims101/downloads/go_to_top.html?attredirects=0&d=1
@Woozgulf
ReplyDeleteThanks you pal! A pleasure indeed :)
this is really cool
ReplyDeleteI add it to my site www.Leechermods.com
I wanted to use this super cool effect with my contact icons so I added an HTML widget with your code. I realized that expanding image class should go outside the "b:skin" tag, in order to work in a widget. Then I wrapped it in a new "style" tag right above "/head".
ReplyDeleteUnfortunately I can't have my icons arranged as I wish (closely floated on the left): I tried to play with borders, margins, padding, floating, and everything I could think about (I'm not an expert coder) but my icons seem not to acknowledge my effort.
Actually my html works perfectly in a sandbox, but something goes wrong when I put it in a Blogger HTML widget. Any idea please? Thanx.
@Art
ReplyDeletedude the CSS code is always added above /b:skin tag and even if you enclose it between style tags it makes no difference.
What you have to do is that if your wish to add this effect to an HTML/JAvaScript widget then first paste the CSS code inside your template (The first code as guided above) and for the HTML part do this,
1) Inside HTML/JavaScript widget enclose every single Icon between this code,
<div class="MBT-CSS3">
<img src="Image URL Of Your Icon#1" />
</div>
To add this effect to another icon simply keep on adding this code
<div class="MBT-CSS3">
<img src="Image URL Of Your Icon#2" />
</div>
Kindly make sure to replace Image URL Of Your Icon#1 and Image URL Of Your Icon#2 with your Icon link.
If you needed further assistance please let me know.
The effect actually works perfectly by putting the CSS code either in the template, or inside the widget (between "style" tags). I put it in the widget for an easier editing and troubleshooting.
ReplyDeleteIf you kindly take a look at my blog (ilsolitoblog.blogspot.com), you'll see the icons on the upper right. My issue is that there's too much space around them: they're not close to each other, with little padding around.
I can't work out a way to arrange them as I wish: changing padding, margin or float values seems not to produce any effect at all. Do I have to add an extra class with the desired parameters? DO I have to use different properties? Thanks for your help.
@Art
ReplyDeleteSo sorry for my late reply pal. Did you edited margin: 0 10px 5px 0 ?
Don't worry. I'm glad if you find some time to reply, it does't matter when :)
ReplyDeleteYes, I did. I tried all sort of values. As I mentioned, I added padding and float properties, and played around with their values. Nothing changed at all. Margin values work perfectly when I use the code in a sandbox like cssdesk.com but it looks like either blogger just neglects them or I'm doing it really wrong somehow. Any clue?
Thanks so much.
@Art
ReplyDeletePlease take the screenshot and I will make sure you receive the solution in my next reply.
I visited your blog twice and found nothing there. Guess you have removed the images?
I didn't remove the icons. They are on the top right column as you can see in this screenshot:
ReplyDeletehttp://i55.tinypic.com/1zf0f1i.png
I tried out the code in a sandbox and it worked perfecly:
http://i54.tinypic.com/muhgur.png
used this effect in all my blog posts
ReplyDeleteBUT....................
only works in google chrome
not mozzila
seriously .......no mozilla
Mozilla will support image transform from version 4.0
ReplyDeleteMohammad, this is awesome!
ReplyDelete(Just only question:
where do I have to put the second part of the code, which is with URL of picture?
I put it after the main code AND in my post).
@mon
ReplyDeleteYou can put it any where you want the image to appear but add it in HTML mode only not the compose mode.
You are always welcomed. :>
if i have a pic that upload to blogger, where can i find the link to it ?
ReplyDeleteawasum bro workinggggggg thxxxxxxxxxxxxxxxx
ReplyDeletehttp://allmytutorials.blogspot.com/
hi,
ReplyDeletei love it
but i just want to know weather it is possible lo have different colors of drop shadows in each post of my like
suppose in post i want red
in next post i want yellow to match the image
but the previous post color should not change.
plz reply me soon
i hope u understood my question
ReplyDeleteif there is any code plz provide me
it will be very help full for me
Hello Mohammad. Thanks in advance. What I´ve learned here was awesome!
ReplyDeleteNow, I must make a comment about something you wrote at the end... about not working so well with the boring IE... LOL! You are so right about that, boring.... Thanks again, it was fun!
Thank You Very Much, But is there any code to add the effect automatically to all images.
ReplyDeletePR-Blogger
how to change read more with an image.......it will be good if i can get like yours......
ReplyDeleteHi How to get Expanding i mean stream ads to blogger
ReplyDelete