纯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>

转载于:https://www.cnblogs.com/yongzhi/articles/1267664.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值