惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 热门话题
T
The Blog of Author Tim Ferriss
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
D
Docker
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
Recent Announcements
Recent Announcements
雷峰网
雷峰网
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
美团技术团队
C
Cisco Blogs
V2EX - 技术
V2EX - 技术
N
News and Events Feed by Topic
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
C
CERT Recently Published Vulnerability Notes
S
Secure Thoughts
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
W
WeLiveSecurity
The Register - Security
The Register - Security
T
Tenable Blog
J
Java Code Geeks
The Cloudflare Blog
有赞技术团队
有赞技术团队
博客园 - 聂微东
P
Palo Alto Networks Blog
Security Latest
Security Latest
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
SegmentFault 最新的问题
H
Hacker News: Front Page
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Exploit Database - CXSecurity.com
S
Security @ Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Hacker News: Ask HN
Hacker News: Ask HN

博客园 - zzh

Making IE use PNG Alpha transparency 关于div高度自适应问题,兼容IE和火狐 C#利用短信猫收发短信息的方法 String[3]: the Size property has an invalid size of 0. - zzh XML Serializable Generic Dictionary C#中的多线程——线程同步基础 安装window service 中出现Set Service Login对话框 input style兼容IE6的方案 - zzh - 博客园 document.body.scrollTop为0的处理办法 js 获取浏览器高度和宽度值(多浏览器) Assembly Manifest 通俗简易手册 C# Enumeration 使用 关于页面的已终止操作 - zzh - 博客园 DOM标准与IE的html元素事件模型区别 访问ASP.NET临时文件夹的权限问题 打架必备!擒敌拳1-16动连贯动作 分解动作 Ajax错误提示Sys未定义解决方法 - zzh - 博客园 解决js中onMouseOut事件冒泡的问题 javascript 中的this 与事件注册 及event
IE上关于PNG做背景,层上超链接不能点击的解决办法 - zzh - 博客园
zzh · 2009-11-24 · via 博客园 - zzh

CSS代码:

<style type="text/css">
.pngbg{background:url(menubarbg.png) no-repeat;}
.pnglink{height:145px;width:232px;}
#area{left:20px;top:20px;position:relative}
</style>
<!--[if lt IE 7]><style>
.pngfixed {filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='menubarbg.png', sizingMethod='crop'); 
}
.pngbg {background-image: none;}
</style><![endif]-->

Html代码:

<div class="pngbg pnglink">
<div class="pnglink pngfixed">
<div id="area">
<a href="http://www.enterdesk.com">Fixed PNG-A-HREF-Cann't Click</a>
</div>
</div>
</div>

几个注意的地方,这个是解决IE下出现的问题,FF没问题
1.ID=area的DIV,是放置PNG背景层上的内容,此DIV需有position属性,absolute 或者relative都行,position有继承关系,所以最好前面的DIV也设置position,这样定位方便.
2.背景的高度定义在.pnglink这个class里面,不可定义在pngbg的class里面

能点和不能点的演示地址:http://www.dodo.hk/play/png.html

 ///我使用后的心得

不需要这么复杂,问题在于PNG层的CSS不要设置为Position:Relative;可以在中间加一个Relative层,在这个层里面加上内容,其上的事件都可以响应。

 CSS代码:

.Relative

{

position:relative;

div#News

{

width:365px;height:188px;background:url('/Images/beijing.png') no-repeat;float:left;

}

* html div#News { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="/Images/beijing.png");background-image: none; }

div#News div#More

{

width:39px;height:13px;position:absolute;top:160px;right:10px;background:url('/Images/more.gif') no-repeat;

}

div#News div#NewsItems

{

width:340px;height:110px;position:absolute;top:45px;left:15px;

}

HTML代码: 

         <div id="News">

            <div class="Relative">

                <div id="NewsItems">

                    ...

                </div>

                <div id="More"></div>

            </div>                

        </div>