开发者

Max div height in Internet Explorer

开发者 https://www.devze.com 2023-01-18 03:47 出处:网络
How can I have a 开发者_运维知识库div of static 60px height in Internet Explorer?<div style=\"height: 60px; overflow: hidden;\">Hello, World</div>

How can I have a 开发者_运维知识库div of static 60px height in Internet Explorer?


<div style="height: 60px; overflow: hidden;">Hello, World</div>

Some versions of IE don't follow max-height, unfortunately, and that's where overflow: hidden comes in handy. Note that the div will ALWAYS have 60px height no matter what's inside it.


#el {
    height:expression(this.scrollHeight>59?"60px":"auto");     
}


<div style="height: 60px;">This is my div</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消