一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

兼容IE6的最小最大宽度与高度(min-width,max-width)写法

时间:2013-11-30 编辑:简简单单 来源:一聚教程网

IE6最小最大宽度:

 代码如下 复制代码

.min-width {
 min-width:600px;
 _width:expression(document.body.clientWidth < 300 ? "300px" : "auto");
}

.max-width {
 max-width: 600px;
  _width:expression(document.body.clientWidth > 600 ? "600px" : "auto");
}

IE6最小最大高度:

 代码如下 复制代码

.min_height{
  min-height:200px;
  _height:expression(this.scrollHeight < 200 ? "200px" : "auto");
}

.max_height{
  max-height:400px;
  _height:expression(this.scrollHeight > 400 ? "400px" : "auto");
}


IE6最大最小宽度:

 代码如下 复制代码

.min_and_max_width{
  min-width:300px;
  max-width:600px;
  _width: expression(document.body.clientWidth < 300 ? "300px" :( document.body.clientWidth > 600 ? "600px" : "auto"));
}

.min_and_max_width {
    border:solid 1px red;
    height:500px;
    max-width:600px;
    min-width:300px;
 _width: expression(  document.body.clientWidth < 300 ? "300px" :
 ( document.body.clientWidth > 600 ? "600px" : "auto")  );
}

IE6最大最小高度:

 代码如下 复制代码

.min_and_max_height{
  min-height:200px;
  max-height:400px;
  _height: expression(
    this.scrollHeight < 200 ? "200px" :
      ( this.scrollHeight > 400 ? "400px" : "auto")
  );
}

热门栏目