=波波日志 > HTML/WML/CSS兼容/XML > CSS实现IE6支持min-width,min-height=
[转]CSS实现IE6支持min-width,min-height
IE6浏览器不支持min-width,min-height这2个css,所以需要另外写css来控制IE6下的min-height,min-height
来源:www.cnblogs.com/yongzhi/articles/1267664.html
+展开
-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*/
_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>
<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>
来源:www.cnblogs.com/yongzhi/articles/1267664.html
类别:HTML/WML/CSS兼容/XML 作者:转载 日期:2011-04-01 【评论:0】
相关文章
- ·jQuery IE6下width(),height()获取document的高和宽不精确
- ·div+css兼容IE和firefox等浏览器方法
- ·firefox 支持自定义 CSS cursor
- ·如何解决:window.opener=null;window.close(),只支持IE6不支持IE7的问题?
- ·IE6下css样式表ID选择器不能以下划线开头
- ·实现支持断点续传多线程下载的 Http Web 客户端工具类 (C# DIY HttpWebClient)
- ·JavaScript Table行定位效果
- ·26.5.支持IME设备
- ·IE6下按百分比布局的问题
- ·IE6下的119个bug
- ·div高度在IE6显示不正常
- ·CSS 属性
暂时没有评论!
发表留言

