codehutch.com

Online Code Repository

Image Opacity Using CSS

Here is an illustration on how to use CSS to modify the opacity of ‘image-links’ and create a nice effect

CSS:

img{
border:none;
}

updated version

.link img{
-ms-filter: “alpha(opacity=50)”; /*IE 8*/
filter: alpha(opacity=50); /*lower IE versions*/
opacity: 0.5; /*FF*/
}

.link:hover img{
-ms-filter: “alpha(opacity=100)”; /*IE 8*/
filter: alpha(opacity=100); /*lower IE versions*/
opacity: 1; /*FF*/
}

deprecated

.link img{
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
-moz-opacity: 0.5;
}

.link:hover img{
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
-moz-opacity: 1;
}

How to use:

<a href=”#” class=”link” ><img src=”superman.jpg”/></a>

Sample:

Thanks for the input j.j.  :)



Tags:

I was trying to deploy my Project using Visual Studio 2008 a while ago, when I encountered this Error:

“It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level This error can be caused by a virtual directory not being configured as an application in IIS.”

And I had no idea why it was happening. I was not even trying to access my project in a browser (I was just trying to deploy!). I wasted almost an hour trying to figure it out before I luckily stumbled to Rob Gruen’s blog. Though his case was different (I did not upgrade), I hurriedly followed his suggestion. I search for web.config file in my project’s folder and to my surprise, there were two of them. Suddenly, I remember that I was testing something and added a test-website inside my project which contains a web.config file. I just deleted the whole test-website and, boom! the deployment went smoothly. So, if you encounter this error, just remember that you cannot use multiple web.config in one application.



Tags: