top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In css how to make background image as a transparent?

0 votes
302 views

Please provide any sample codes..

posted Sep 2, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

The CSS3 property for transparency is opacity.

img {
    opacity: 0.4;
    filter: alpha(opacity=40); /* For IE8 and earlier */
}

Image Transparency - Hover Effect

<!DOCTYPE html>
<html>
<head>
<style>
img {
    opacity: 0.4;
    filter: alpha(opacity=40); /* For IE8 and earlier */
}

img:hover {
    opacity: 1.0;
    filter: alpha(opacity=100); /* For IE8 and earlier */
}
</style>
</head>
<body>

<h1>Image Transparency</h1>
<img src="klematis.jpg" width="150" height="113" alt="klematis">
<img src="klematis2.jpg" width="150" height="113" alt="klematis">

<p><b>Note:</b> In IE, a !DOCTYPE must be added for the :hover selector to work on other elements than the a element.</p>
</body>
</html>
answer Sep 2, 2014 by Amit Kumar Pandey
...