著作權聲明:原創作品,允許轉載,轉載時請務必以超連結形式標明文章原始出版、作者資訊和本聲明。否則將追究法律責任。http://blog.csdn.net/mayongzhan - 馬永占,myz,mayongzhan
今天在家上cy,用ie,ff看網頁都很正常,然後用tt,結果發現首頁上沒有寵物和廣告,想到了去tt設定裡看一下,果然有個選項是隱藏浮動網頁元素,把鉤去掉,寵物和廣告都出來了。突然想到csdn部落格上的ggad是不是也是這個毛病,結果開啟首頁一看,廣告沒有消失,困擾我幾個月的問題,終於在不經意間解決,幸運。
tt怎樣屏蔽浮動網頁元素? 什麼是tt認為的浮動網頁元素?
position: absolute;的不算,z-index: 100的也不算,
只有當position:absolute結合內部標籤有img,object,iframe時,tt會認為是浮動元素。
gg廣告的組成就是postion:absolute加上一個iframe,所以會被tt屏蔽掉。
下面是測試代碼,測試覆蓋不完全,但是已經夠用了。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="馬永占(MyZ)" />
<meta name="Copyright" content="馬永占(MyZ)" />
<meta name="description" content="" />
<meta name="keywords"content="" />
<link rel="icon" href="" type="image/x-icon" />
<link rel="shortcut icon" href="" type="image/x-icon" />
<link href="" rel="stylesheet" type="text/css" />
<script type="text/javascript" src=""></script>
<title></title>
<style type="text/css">
<!--
-->
</style>
</head>
<body>
<div style="position: relative;">0</div>
<div style="position: absolute;">1</div>
<div style="position: absolute; top: 0px; left: 50px;">2</div>
<div style="position: absolute; top: 0px; left: 100px; z-index: 100;">3</div>
<div style="position: absolute; top: 0px; left: 150px; z-index: 100;"><div>4</div></div>
<div style="position: absolute; top: 0px; left: 170px; z-index: 100;"><div><img width="40px" height="40px" src="http://www.baidu.com/img/baidu_logo.gif" /></div></div>
<div style="position: relative;"><img src="http://www.baidu.com/img/baidu_logo.gif" /></div>
<div style="position: absolute;"><img src="http://www.google.cn/intl/zh-CN/images/logo_cn.gif" /></div>
<div style="position: absolute; top: 0px; left: 200px;"><img src="http://www.google.cn/intl/zh-CN/logos/Logo_25gry.gif" /></div>
<div style="position: absolute; top: 0px; left: 300px; z-index: 100;"><img src="http://www.google.cn/intl/zh-CN/logos/fathersday08.gif" /></div>
<div style="position: absolute; top: 0px; left: 500px; z-index: 100;">
<object height="160" width="550" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://www.flash8.net/UploadFla/10/flash8net_9587.swf" name="movie"/>
<param value="high" name="quality"/>
<embed height="160" width="550" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="/UploadFla/10/flash8net_9587.swf"/>
</object>
</div>
<div style="position: absolute; top: 0px; left: 600px; z-index: 100;">
<iframe src="test2.php"></iframe>
</div>
</body>
</html>