min-height hack/workaround in IE6,IE7 & Firefox

June 13, 2008

Hey i was wondering how to use min-height for all the 3 browsers and came across a workaround and which works wonders in all the 3 browsers.

selector {
min-height: 103px;
_height: auto !important;
height: 103px;
border:1px solid red;
}

In case it helps please leave a comment.

Entry Filed under: css. Tags: , , , .

12 Comments Add your own

  • 1. joe  |  July 18, 2008 at 2:42 am

    works for me! thanks a bunch!

    Reply
  • 2. jamie  |  September 5, 2008 at 4:06 am

    does _height work?

    Reply
  • 3. Furious Photographers  |  September 11, 2008 at 10:04 pm

    I’m curious myself never heard of that command but am willing to try! I can’t wait for Chrome to rule them all so that we don’t have to use so many hacks

    Reply
  • 4. Andy  |  September 14, 2008 at 7:57 pm

    Works great thank you!!

    Reply
  • 5. Jonah H  |  November 26, 2008 at 7:04 am

    Thanks, this worked for me on a recent project.

    Reply
  • 6. epos  |  January 21, 2009 at 4:53 pm

    Works a treat. Thanks. I have just spent about an hour trying to sort this out before reading your post.

    Again, thank you.

    Reply
  • 7. Lucas  |  January 23, 2009 at 12:37 pm

    Hola.
    Mejor omitir “height: 103px;” porque en FF elimina el min-height.

    Con solo tenemos suficientamente

    min-height:159px; (para FF3, Opera, googlechrome)
    _height:auto !important; (para IE6 y IE7)

    Saludos
    Lucas

    Reply
  • 8. Michele  |  January 23, 2009 at 1:32 pm

    Great help, thank you!

    Reply
  • 9. wazime  |  February 23, 2009 at 1:17 am

    Thanks for this hack, it will come in handy as I redesign my blog.

    Reply
  • 10. Harvey  |  March 26, 2009 at 1:47 pm

    Perfect, thank you.

    Reply
  • 11. Coder Jones  |  July 17, 2009 at 4:01 pm

    You’re just hard-coding the height. That breaks in Firefox if you want the element to be able to expand.

    Reply
  • 12. vadivel  |  October 8, 2009 at 9:38 am

    i need css hack for all browser ie 6,7,8 &firefox,google chrome

    Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Spam Blocked

Flickr Photos

Freeze

*

Cabo Negro

More Photos

Blogroll

Recent Posts

Recent Comments

Brightshore Miami on Convert em,px,pt and % in…
zolofth on Mozilla Addons and IE Addons f…
xx on validating textarea using…
jafar on Top 50 Govt Engineering C…
jafar on Top 50 Govt Engineering C…

Pages

Top Clicks

Top Posts

Blog Stats