博客新地址

http://wyz.67ge.com/

纯CSS实现IE6支持min-width

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>纯CSS实现IE6支持min-width</title>
<style>
body 
{
zoom
: 1;  /* 触发hasLayout */
_border-right
: 750px solid #fff; /* 对body设定一个右边框,这个宽度就是页面的min-width */
_padding
: 0 16px 0 0; /*16px =  #doc:margin-right*/
_filter
: progid:DXImageTransform.Microsoft.Chroma(color="#ffffff"); /*remove teh border-right color*/
}
#doc 
{
/* IE6: min-width */
position
: relative; /*prevent IE from inheriting filter:progid:DXImageTransform.Microsoft.Chroma()*/
_margin-right
: -750px; /* 这个负的右边距可以让这个内容与body的边框重合而不挤压,从而可以利用body的边框来达到min-width */
zoom
: 1;

background-color
:#333;
min-width
:750px;/*IE7 所支持的min-width*/

}
</style>
</head>

<body>
<div id="doc">纯CSS实现IE6中的min-width</div>
</body>
</html>
posted @ 2008-08-14 11:21  yongzhi  阅读(1760)  评论(0编辑  收藏  举报

博客新地址

http://wyz.67ge.com/