iframe 自适应高度 宽度 全css 实现 无 javascript
<html>
<body style="margin:0;">
<div>
<table style="width:100%;height:100%" cellpadding='0' cellspacing='0'>
<tr>
<td style="width:120px;background-color:Red">
<iframe id="MU" name="MU" style="position:absolute;top:auto;bottom:0px;height:100%;left:auto;right:0px;width:100%">
</iframe>
</td>
<td style="background-color:Yellow">
<iframe id="WA" name="WA" style="position:absolute;top:0px;bottom:0px;left:120px;right:0px;width:100%;height:100%"
src="about:blank">
</iframe>
<div >a</div>
</td>
</tr>
</table>
</div>
</body>
</html>
注: position:absolute;top:auto;bottom:0px;height:100%;left:auto;right:0px;width:100%
去掉top:auto;bottom:0px;height:100%;为宽度自适应
去掉left:auto;right:0px;width:100%为高度自适应
相关文档:
//css样式的书写
//元素ID
#tb1{width:100%;height:80px;background-color:#FFD700;padding:4px;font-family:verdana,tahoma;font-weight:bold;}
#tb2{width:100%;padding:4px;font-family:verdana,tahoma;margin:12px
0px 0px 0px;background-color:#EEEEEE;font-weight:bold;}
//类
.test{cursor:hand;
&nb ......
display Property Values
ValueDescription
none
The element will generate no box at all
block
The element will generate a block box (a line break before and after the element)
inline
The element will generate an inline box (no line break before or after the element). This is default
inline-blo ......
请看下面一段代码:
<HTML>
<HEAD>
<style>
#login {font-size:14px;color:blue;}//定义了一个ID
.left{FONT-SIZE=12PX;COLOR=RED;TEXT-ALIGN=CENTER;}//定义了一个类
</style>
<TITLE>中国</TITLE>
<BODY>
<DIV STYLE="FONT-SIZE=12PX;COLOR=RED;TEXT-ALIGN=RIGHT; ......
第二讲 div+css标准布局
优点:内容和样式分离
margin:外边距
举例:
.bianju{
margin-top:40cm;
margin-left:10cm;
margin-right:10cm;
margin-bottom:15cm;
}
或者写成:
.bianju{
margin:1cm 2cm 3cm 4cm; (左右上下)如果只写一个,是4边都是一个固定的值
margin:auto   ......