html xmlns="https://www.jb51.net/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>CSS实现最小宽度</title> <style type="text/css"> body{ text-align:center;} .ie6-out{ _margin-left:900px; _zoom:1; } .ie6-in{ _position:relative; _float:left; _margin-left:-900px; background:#f00; line-height:200px; } #min-width{ min-width:900px; background:#ccc; _zoom:1; } </style> </head> <body> <div class="ie6-out"> <div class="ie6-in"> aa </div> </div> <div class="ie6-out"> <div class="ie6-in"> aa<div id="min-width">ie6-下,容器实现模拟min-width效果。请任意改变浏览器窗口大小,再点击按钮"查看宽度"。</div> </div> </div> <input name="" type="button" onclick="alert('容器宽度='+document.getElementById('min-width').clientWidth+'px'+'\n\n'+'视口宽度='+(document.documentElement.clientWidth||document.body.clientWidth)+'px');" value="查看宽度" /> </body> </html>