min-height: auto not working in Opera

Alvaro picture Alvaro · Oct 25, 2012 · Viewed 9.5k times · Source

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?

Answer

BoltClock picture BoltClock · Oct 25, 2012

CSS2.1 defines the initial value of min-height to be 0, not auto. The value auto never existed in CSS2.1, so it is invalid in CSS2.1. Just use min-height: 0 instead:

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