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

推荐订阅源

The Register - Security
The Register - Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
V
Visual Studio Blog
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
C
Check Point Blog
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
L
LangChain Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security @ Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
H
Hacker News: Front Page
L
Lohrmann on Cybersecurity
T
Troy Hunt's Blog
T
Threat Research - Cisco Blogs
A
About on SuperTechFans
T
Threatpost
AWS News Blog
AWS News Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
Tor Project blog
Google Online Security Blog
Google Online Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tenable Blog
W
WeLiveSecurity
博客园 - 叶小钗
K
Kaspersky official blog
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence
Hacker News - Newest:
Hacker News - Newest: "LLM"
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
小众软件
小众软件
D
Docker
爱范儿
爱范儿
C
Cyber Attacks, Cyber Crime and Cyber Security
N
News and Events Feed by Topic
S
Schneier on Security
博客园 - 三生石上(FineUI控件)
D
DataBreaches.Net

博客园 - 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>