Feedback

12 Feb 2013

Opacity/Transparency To An Image Using CSS

add opacity for imagesOpacity / 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
opacity of image in blogger
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.
 

People

My Photo
We are also on Facebook We are on Twitter Home Page
Hello friends i am Jaskaran SH SD from Amritsar (Punjab) India. I love blogging. First I started a blog on science in 2010. Now I handle only this blog. I like to share the things which I know. I learn many things through blogging. I always try to make different that's why I learn many things. 

About Blog

Construct Internet is one of dedicated source for Internet, Computer and technology tutorials and development. It is Started in Oct 21 2012. We provide a professional tools for websites and blogging, along with a wide range of tutorials, How to fix etc. for computers and other technology development. Social news, Business and Social Science like topics are also followed in our blog.

We 'r Social

2012-2013 Construct Internet. Copying Without Permission is Strictly Prohibited.