我想對外部網站添加一些廣告,這樣做,我使用iframe:帶有css固定位置的iframe:可能嗎?
<!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">
<body style="background:#ddd">
<center>My ad</center>
<iframe src="http://www.google.com" style="position:fixed; top:50px; left:0; width: 100%; bottom: 0; border: 0 ">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
的iframe是在正確的位置,但「底部:0」不工作:爲什麼呢? 我想iFrame遵循窗口大小調整:如何繼續?
這幾乎可以工作,但iframe內容的底部會低於容器的底部,因爲top:50px和height:100% – Richard 2012-02-25 00:11:14