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

推荐订阅源

N
News and Events Feed by Topic
D
Docker
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
L
LangChain Blog
H
Help Net Security
B
Blog
T
Tailwind CSS Blog
V
V2EX
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
美团技术团队
A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
I
InfoQ
Project Zero
Project Zero
I
Intezer
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AWS News Blog
AWS News Blog
Spread Privacy
Spread Privacy
S
Securelist
Recorded Future
Recorded Future
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 叶小钗
S
Security Affairs
Blog — PlanetScale
Blog — PlanetScale
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
The Hacker News
The Hacker News

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