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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - Amanda2007

用户中心 - 博客园 用户中心 - 博客园 Silverlight不支持GIF或BMP文件格式 RotateTransform的CenterX和CenterY和元素的RenderTransformOrigin属性与 用户中心 - 博客园 用户中心 - 博客园 用户中心 - 博客园 用户中心 - 博客园 用户中心 - 博客园 用户中心 - 博客园 用户中心 - 博客园 用户中心 - 博客园 为什么silverlight的PasswordBox控件的password属性不可以绑定?该如何实现绑定? 用户中心 - 博客园 如何获取silverlight 应用程序的版本号。 如何自定义datagrid控件的某一行。 鼠标进入离开DataGrid的行的操作。 背景图片的自适应 为canvas添加背景图片
在网页上设置容器的高度的百分比。
Amanda2007 · 2008-08-21 · via 博客园 - Amanda2007

   想在网页上放两个iframe,按比例设置他们的高度,

<iframe name="iframe1" src="http://www.google.com/" height="25%" width="100%"></iframe>
          <iframe name="iframe2" src="http://www.google.com/"  height="75%" width="100%"></iframe>

但是发现,设置比例高度根本就没有其任何作用。

后来发现, 在网页中放一个div,并设置他的高度和宽度都为100%,显示结果是,宽度显示正常,但是高度却只有一行的高度。

后来,在网上搜索的一片文章: http://blog.darkthread.net/blogs/darkthreadtw/archive/2007/10/02/tips-get-100-height-in-xhtml.aspx

原来問題的根源不在於XHTML不支持100%了,而是預設HTML長度改成依內容而訂不再一次佔滿整個瀏覽器的可視範圍,

所以在网页的 header部分添加 如下的css, 问题就解决了:

<style type="text/css">
html, body 
{ margin: 0; padding: 0; height: 100%; border:none; }
</style>