问一个简单的css滚动条宽度兼容IE7和IE6的问题._html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:22:39
Original
1537 people have browsed it

RT。

比如我一个div,定义overflow-y:auto; max-height:440px;width:440px;
此时在其下有个table,是这么定义的样式:width:100%; border:1px solid #e2e2e2; border-collapse: collapse;
此时当在火狐,谷歌,IE8以上时,当table内容高度大于440px的时候,会出现滚动条,此时table的宽度会自动变成420px,即width-browser.scroll.width(意会,打汉字太麻烦)。
但是IE7下不会自动变窄给滚动条流出宽度,而是会在下方出现滚动条。如果设上overflow-x:hidden,table的内容就会被scroll覆盖一部分。



所以,求大神指教下这个怎么调?
必须兼容IE7和6,老总要求的。


回复讨论(解决方案)

ie6不支持max-height,写成:max-height:440px;_height:440px;

ie6不支持max-height,写成:max-height:440px;_height:440px;

老兄我是在问宽度的问题啊。。。

可以参考 http://bbs.blueidea.com/thread-3022471-1-1.html

可以参考 http://bbs.blueidea.com/thread-3022471-1-1.html

明显有BUG啊,老兄!
我自己写个js实现了。
var tah=$("#modelTab").css("height");
tah=tah.toString().replace("px","");
if(parseInt(tah)>400)
{$("#modelTab").css("width","425px");}


可以参考 http://bbs.blueidea.com/thread-3022471-1-1.html

明显有BUG啊,老兄!
我自己写个js实现了。
var tah=$("#modelTab").css("height");
tah=tah.toString().replace("px","");
if(parseInt(tah)>400)
{$("#modelTab").css("width","425px");}

老弟啊,这貌似是IE6的bug,没有统一的解决方案,只有拐弯抹角。你的问题解决了就行

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!