Elliot Reeve’s Blog
Technology, Web, Programming, Computers and Gadgets
Technology, Web, Programming, Computers and Gadgets
Mar 20th
There are lots of “fixes” for transparent png images in Internet Explorer which remove the “white block” bug in lower versions of Internet Explorer however some dont work as well as others.
Some flaws I have found with some methods:
I recently came across what seems like a very good solution and a big advantage of this is that its not difficult to add into your pages therefore you have the choice of making a style-sheet for Internet Explorer or applying the PNG for IE fix to all browsers.
This will give you the solution that your looking for, this method also allows the image you are using to be repeated so you can repeat a transparent background image.
The one down side of this method is that you can now no longer click links on top of your background, however there is a solution to this problem and that is to create another div inside the the background div which just has the property of: position: relative;.
Your code should look something like this when your finished:
Code:
<div class=”backgroundimage”>
<div class=”textlayer”>Text goes in here</div>
</div>
CSS:
.backgroundimage {
background: url(image.png) repeat-y;
_background-image: none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=’true’, sizingMethod=’scale’, src=’image.png’);}
.textlayer{
position: relative;
}
I hope you find this useful, any problems add a comment and ill do my best to help you.