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对各个浏览器兼容已经是老生常谈的问题了, 网络上的教程遍地都是.以下内容没有太多新颖, 纯属个人总结, 希望能对初学者有一定的帮助.
一、CSS HACK
以下两种方法几乎能解决现今所有HACK.
1, !important
随着IE7对!important的支持, !important 方法现在只针对IE6的HACK.(注意写法.记得该声明位置需要提前.)
< ......
div+css浏览器兼容问题解决方法
从网上收集了IE7,6与Fireofx的兼容性处理方法并整理了一下.对于web2.0的过度,请尽量用xhtml格式写代码,而且DOCTYPE 影响 CSS 处理,作为W3C的标准,一定要加 DOCTYPE声名.
CSS技巧
1.div的垂直居中问题 vertical-align:middle; 将行距增加到和整个DIV一样高
line- ......
png透明 AlphaImageLoader
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=bEnabled,sizingMethod=sSize,src=sURL)
enabled:可选项。布尔值(Boolean)。设置或检索滤镜是否激活。true:默认值。滤镜激活。false:滤镜被禁止。
sizingMethod:可选项。字符串(String)。设置或检索滤镜作用的对象的图 ......
第二讲 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   ......