8

I have noticed that min-height is not working in Opera. I am trying something like this:

<div class="content"><div>
<div class="content newstyle"><div>

And my CSS code is:

.content {
    min-height: 600px;
}
.newstyle {
    min-height: auto;
}

And Opera just acts like min-height didn't exist.
If I apply any other style in .newstyle, like background or whatever, then it works well. But min-height: auto seems not to work...

Any idea?

4

2 回答 2

14

min-heightCSS2.1 定义了to be的初始值0,not auto该值auto在 CSS2.1 中从未存在,因此在 CSS2.1 中无效。只需使用min-height: 0

.content {
    min-height: 600px;
}
.newstyle {
    min-height: 0;
}
于 2012-10-25T14:17:20.710 回答
6

auto; is not a valid value for min-height property and hence Opera ignores...

You can specify min-height using px, cm etc, or % or inherit

Sitepoint Reference

于 2012-10-25T14:09:43.413 回答