Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

Min hight in css

  • Please log in to reply

#1 denvarghese



  • Banned
  • 50 posts

Posted 11 June 2014 - 12:41 AM


We can give a min hight to a div like this.

{min-height:400px;height:auto !important;height:400px} So it will be expanded if the content more than this 400px. it will work in all IE versions too.

#2 pbasset1977


    Junior Member

  • Designer
  • 9 posts

Posted 20 June 2014 - 02:04 AM

With the way you have that code written, a browser is going to have a hard time trying to understand what you want to do with it.

min-height is a way to give a div a specific height, if the content doesn't push it further. What I mean is if you have one word in a div, but give it a min-height of 400px, the div is going to be 400px high. If you put in three paragraphs of content, the div will expand to fit all the content past 400px.

height: auto !important; will override all the other height requirements you've given because it's tagged important. I don't recommend using the important tag if you don't have to.

height: 400px; will give your div a height of 400px, but never expand beyond that. If you're trying to give it a height for a visual effect and nothing more, feel free to use that. If you're trying to surround content, use min-height so it will auto expand.

Let me know if any of that doesn't make sense and I'll try to explain it more.

Good luck!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users