Maximum div height in Internet Explorer

How can I get a div from a static height of 60 pixels in Internet Explorer?

+6
html css internet-explorer
source share
3 answers
<div style="height: 60px; overflow: hidden;">Hello, World</div> 

Some versions of IE are not related to max-height, unfortunately, and that is where overflow: hidden comes in handy. Note that the div will ALWAYS have a height of 60 pixels, no matter what is inside it.

+4
source share
 #el { height:expression(this.scrollHeight>59?"60px":"auto"); } 
+3
source share
 <div style="height: 60px;">This is my div</div> 
0
source share

All Articles