在网页页面制做中常常要操纵div宽度最大宽度/高宽比或最少宽度/高宽比,可是在IE6中许多盆友都会遇到兼容问题的头疼难题,包含我也常常遇到这样的难题,在百度搜索查了许多都无法处理,后来在1个论坛念书习到,在这里跟大伙儿共享下css3款式编码,历经時间彻底适配各大流行访问器。
CSS Code拷贝內容到剪贴板
- * 最少寬度 */
- .min_width{min-width:300px;
-
- _width:expression(document.body.clientWidth < 300 ? "300px" : "auto");
- }
-
-
- .max_width{
- max-width:600px;
-
- _width:expression(document.body.clientWidth > 600 ? "600px" : "auto");
- }
-
-
- .min_height{
- min-height:200px;
-
- _height:expression(this.scrollHeight < 200 ? "200px" : "auto");
- }
-
-
- .max_height{
- max-height:400px;
-
- _height:expression(this.scrollHeight > 400 ? "400px" : "auto");
- }
-
-
- .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_height{
- min-height:200px;
- max-height:400px;
-
- _height: expression(
- this.scrollHeight < 200 ? "200px" :
- ( this.scrollHeight > 400 ? "400px" : "auto")
- );
- }
以上便是网编为大伙儿带来的CSS操纵div宽度最大宽度/高宽比和最少宽度/高宽比的方式所有內容了,期待大伙儿多多适用脚本制作之家~