William Duffy

Glasgow Based ASP.NET Web Developer

Min-Height in Internet Explorer

Do you ever need to specify a min-height for an element on your site? You’ll know if you do that Internet Explorer does not play fair with it. Here is a nice, clean solution that you can use to get full browser support.

1
2
3
4
5
.minHeight100 {
        min-height: 100px;
        height: auto !important;
        height: 100px;
}

I normally condense it into one line when using it in production.

1
2
3
4
.minHeight80 {min-height: 80px; height: auto !important; height: 80px;}
.minHeight120 {min-height: 120px; height: auto !important; height: 120px;}
.minHeight130 {min-height: 130px; height: auto !important; height: 130px;}
.minHeight240 {min-height: 240px; height: auto !important; height: 240px;}
Bookmark and Share
  Kick It on DotNetKicks.com

Tagged as , , , + Categorized as HTML & CSS

1 Comments

  1. Johnson Mpeirwe says:

    I have been looking at your site http://www.wduffy.co.uk. You have beautiful and impressive designs, I am impressed.

    Regards,
    Johnson

Leave a Reply