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

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
量子位
博客园_首页
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Forbes - Security
Forbes - Security
IT之家
IT之家
N
News and Events Feed by Topic
S
Security Affairs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Webroot Blog
Webroot Blog
Recorded Future
Recorded Future
L
LangChain Blog
Y
Y Combinator Blog
AI
AI
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Know Your Adversary
Know Your Adversary
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google Online Security Blog
Google Online Security Blog
V2EX - 技术
V2EX - 技术
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
PCI Perspectives
PCI Perspectives
I
Intezer
T
Tenable Blog
G
Google Developers Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
有赞技术团队
有赞技术团队
O
OpenAI News
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
C
Check Point Blog
Last Week in AI
Last Week in AI
S
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
Blog — PlanetScale
Blog — PlanetScale

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