DIV+CSS 解决高度自适应办法 兼容多浏览器
2011/8/30 14:51:04 类别:DIV+CSS摘要:通过隐藏容器溢出和正负内补丁方法解决兼容主流浏览器中DIV布局高度自适应的问题
DIV布局中,高度自适应是常用的一种方法,但往往达到不自己想要的效果. 这里直接贴网上目前通用的方法 利用隐藏溢出和正负补丁方法实现的 高度自适应
<html> <head> <title>DIV+CCS 高度自适应解决方案 </title> <meta name="description" content="下面介绍采用 隐藏容器溢出 和 正内补丁 和 负外补丁 结合的方法" /> <style type="text/css"> <!-- #wrap{overflow:hidden;} #sidebar_left,#sidebar_right{padding-bottom:100000px;margin-bottom:-100000px;} --> </style></head> <body> <div id="wrap" style="width:300px; background:#FFFF00;"> <div id="sidebar_left" style="float:left;width:100px; background:#FF0000;">Left</div> <div id="sidebar_mid" style="float:left;width:100px; background:#666;"> </div> <div id="sidebar_right" style="float:right;width:100px; background:#0000FF;">Right</div> </div> </body> </html>
如果你有更好的办法或者思路,请在评论中分享~
下一篇:暴风雨后的宁静!
上一篇:思淇关键词工具(V1.2)更新完毕