Matteo
Matteo

Reputation: 2049

Max div height in Internet Explorer

How can I have a div of static 60px height in Internet Explorer?

Upvotes: 6

Views: 947

Answers (3)

meder omuraliev
meder omuraliev

Reputation: 186742

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

Upvotes: 3

cypher
cypher

Reputation: 6992

<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.

Upvotes: 4

Emil Vikstr&#246;m
Emil Vikstr&#246;m

Reputation: 91983

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

Upvotes: 0

Related Questions