Hi,
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.
Min hight in css
Hi,
We can give a min hight to a div like this.
{min-height:400px;height:auto !important;height:400px}...
&nsbp;
#2
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!
Patty
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!
Patty
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users