CSS实现IE6支持min-width,min-height

IE6浏览器不支持min-width,min-height这2个css,所以需要另外写css来控制IE6下的min-height,min-height
+展开
-HTML
<!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*/
_filterprogid: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>


来源:www.cnblogs.com/yongzhi/articles/1267664.html

加支付宝好友偷能量挖...


评论(0)网络
阅读(192)喜欢(1)HTML/CSS兼容/XML