Opacity / Transparency are used by many design blogs to differentiate when a mouse over is done. So this post will teach you how to add opacity to image on your blog post and also for static images used in your template. This trick is very simple and easy to implement for both websites and blogs. So, irrelevant of your blogging platform this trick tutorial will help you to add transparency effect.
For Blogger blogs:
Search for ]]></b:skin> and paste the the written code below ]]></b:skin>
a.opacity img {
-moz-opacity: 0.5;
opacity: 0.5;
filter:alpha(opacity=50);
}
a.opacity:hover img {
-moz-opacity: 1.0;
opacity: 1.0;
filter:alpha(opacity=100);
}Once you are done with this step, add class=”opacity” between the image links using the Edit HTML tab for the post. For an example
Thats it you are done. Check out the live demo for Blogger
For WordPress Blogs:
Go to Appearance > Editor and add the script you find below in it
a.opacity img {
-moz-opacity: 0.5;
opacity: 0.5;
filter:alpha(opacity=50);
}
a.opacity:hover img {
-moz-opacity: 1.0;
opacity: 1.0;
filter:alpha(opacity=100);
}Then go to HTML mode in the post editor and follow the same step as I instructed for Blogger.
For websites:
Add the same CSS code and add class="opacity" as instructed for Blogger.
For static image in you template
For an instance, if you are adding opacity effect for static image in a template you can use this script. This script implies to both blogs and websites.
<img src="http://yourdomain.com/image.png" style="opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" />
Some times your image source starts with <img src at those case just add <a class="opacity"> and end it with </a> along with the CSS file.
Note: For WordPress blogs give around 4-5 minutes to see the effect.









This Feature is Really Awesome! i have Added to my Blog ! Just took only 2 mins to Apply, Your Tutorial is Really Great and Easy to Follow!
Cheers!!!
.-= Karthikeyan´s last blog ..Google Buzz for Mobile =-.
@Karthikeyan – Thanks for the appreciation.
Pingback: Tweets that mention Add Opacity/Transparency To An Image Using CSS | Bloggermint -- Topsy.com
i like it
Found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later
really needed this trick. one of friends wanted to have transparency in an image.
wow! nice!!!
I am a wordpress user and I wanted to ask that where should I paste that code in the editor?
@Vinayak – Paste it in custom.css file
But where in it? I pasted it in the beginning but nothing happened? Where do I have to paste…. is there any code before which i have to paste it?
Add class=”opacity” between the image links to make it work forany image that you need to give opacity.
So, I dont have to paste it in the custom.css?
You also need to do that
really good tips
.-= ilmucts´s last blog ..Cara menempelkan flash animasi di blog =-.
Hi!..These tutorials really useful to add more pleasurable images to website design..Great Job!
.-= Philwebservices´s last blog ..Web 20 design marbella =-.
Hello there Franklin, I am also interested in this. (See the most recent blog post on my site.) Your article is great to read; you’ve definitely provided me with lots of food for thought. – cars2scrap
.-= Matthew´s last blog .. =-.
I really like this tutorial. I am using it on my blog: http://experience.amelioraranch.com; however, when I try to the exact same thing for my amexperiencedirectory.com site, I get something “very funky” (that’s a technical term for floating script at the bottom of my images). I am using the same platform and the same theme… it is so strange. Do you have any ideas about what would cause this?