兼容IE6、IE7的min-width、max-width写法( 二 )


_width: expression(this.offsetWidth 100 ? (this.offsetWidth 200 ? 'auto' : '200px') : '100px');
overflow: hidden;
}

兼容IE6、IE7的min-width、max-width写法

文章插图
(图7 IE7)
谢天谢地!终于可以了,开香槟庆祝咯!
Wait,年轻人,都说你太年轻了,还不信
如果我不提醒你,哪天死了你都不知道怎么死的
这次我们使用JS来动态改变控件的内容,看看控件的宽度是否会随之改变
复制代码代码如下:
span class="ie-hack" id="span1"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL/span
span class="ie-hack" id="span2"s/span
input class="ie-hack" id="btn1" type="button" value="https://www.rkxy.com.cn/dnjc/LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL" /
input class="ie-hack" id="btn2" type="button" value="https://www.rkxy.com.cn/dnjc/s" /
复制代码代码如下:
window.onload = function() {
document.getElementById("span1").innerHTML = "s";
document.getElementById("span2").innerHTML = "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL";
document.getElementById("btn1").value = "https://www.rkxy.com.cn/dnjc/s";
document.getElementById("btn2").value = "https://www.rkxy.com.cn/dnjc/LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL";
};
兼容IE6、IE7的min-width、max-width写法

文章插图
(图8-1 正常浏览器)
兼容IE6、IE7的min-width、max-width写法

文章插图
(图8-2 IE6 IE7)
【兼容IE6、IE7的min-width、max-width写法】我们想到的效果应该是图8-1那样的,但这次IE6和IE7携手一起来折磨你了

推荐阅读