IE6 PNG透明CSS黑客不工作 [英] IE6 PNG-transparency CSS hack not working

查看:92
本文介绍了IE6 PNG透明CSS黑客不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我环顾四周,决定使用CSS方法,而不是依赖JS ...我认为企业用户坚持使用IE6也可能有IT部门禁用JS。

I looked around and decided to use a CSS approach rather than rely on JS... I figure the kind of corporate users stuck with IE6 might also have JS disabled by IT departments.

所以在我的HTML我有:

So In my HTML I have:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="ie6.css"><![endif]-->
</head>

<body>
    <img src="media/logo.png"/>
</body>

那么我的ie6.css只包括:

Then my ie6.css consists simply of:

img
{
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(...);
}

然而,这一切都没有丝毫差别,没有透明度。我注释掉了所有的页面,所以它字面上是一个,仍然没有运气。我删除了default.css样式表,但仍然没有区别。

However none of this makes the slightest difference, no transparency. I commented out all the rest of the page so it is literally that one and still no luck. I removed the default.css stylesheet and still no difference.

EDIT
现在可以使用.htc方法,在条件IE6测试块中加载该文件。原来,我的问题是,Windows 7已经锁定文件(我甚至不知道这是什么意思),这阻止了IE从加载/使用它。

EDIT: I now got it working, using the .htc method, loading that file in a conditional IE6 test block. It turned out the problem I was having was that Windows 7 had 'locked' the file (I don't even know what this means) and this blocked IE from loading/using it.

推荐答案

我使用的是以下页面的解决方案: IE PNG支持

继续在线演示在线演示一步一步,你的png将在IE中也是透明的。

I am using the solution of following page: IE PNG support
Following the online demonstration online demonstration step by step, your pngs will be transparent also in IE.

这篇关于IE6 PNG透明CSS黑客不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆