易截截图软件、单文件、免安装、纯绿色、仅160KB

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>
            &nbsp;
        </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 文字与输入框对齐

在进行div+css网页布局的时候,不可避免的需要插入一定的表单元素,input是其中最常见的一种。我们在布局中,常会遇到文本输入框与同处一行的文本不对齐的问题。这个问题设置input的vertical-align:middle属性来解决。
我们来看下面的例子,如何解决文本输入框与文本对齐的问题!
<!DOCTYPE html PUBLIC "-//W3C//DTD ......

CSS层叠加的原则

静态定位:position:static(为position属性的默认值)。    
动态定位:position:relative或position:absolute或position:fixed。    
祖元素:任意包含该元素的元素。     父元素:直接包含该元素的祖元素。     同辈元素:拥有共同的父元素的元素。
注:这些概
念为作者 ......

CSS公用文件

由于各浏览器的默认CSS样式不一样,我们必须写一个CSS Reset统一起来。
通常我的做法是在common.css里写全局控制,这里面也包括header和footer,其它CSS文件就通过@import url(”common.css”);引用。
body{padding:10px;margin:0;background:#fff;font-size:12px;line-height:14px;color:#333;font-family:Ari ......

CSS在IE6,IE7,FIREFOX中的区别

第一种,是CSS HACK的方法
height:20px; /*For Firefox*/
*height:25px; /*For IE7 & IE6*/
_height:20px; /*For IE6*/
注意顺序。
这样也属于CSS HACK,不过没有上面这样简洁。
#example { color: #333; } /* Moz */
* html #example { color: #666; } /* IE6 */
*+html #example { color: #999; } /* IE7 */ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号