.divTest {
min-height: 500px;
height: auto !important;
height: 500px;
}
I have got this following CSS code, I tested it on http://www.cleancss.com/ and it took out the height: 500px. Any reasons why that happened?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
!importantcommands take over any other… so yourheight:500px;line will always be ignored (which is why the optimizer took the line out).If you want your div to have a height of 500px only then your CSS should just be:
If you want your div to have a varying height, no smaller than 500px then your CSS should be:
You don’t need the
!importantfor this css-fragment, unless there’s some other rule that’s effecting the height and you need to override it. You don’t need to specifyheight:autobecause that’s the default style for a div (unless of course you’re inheriting something else ;))If you’re using IE6 there’s a work around: