最小高度:自动在Opera中不起作用 [英] min-height: auto not working in Opera
本文介绍了最小高度:自动在Opera中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我注意到min-height
在Opera中不起作用.我正在尝试这样的事情:
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>
我的CSS代码是:
.content {
min-height: 600px;
}
.newstyle {
min-height: auto;
}
Opera的行为就像min-height
不存在.
如果我在.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...
有什么主意吗?
推荐答案
CSS2.1将min-height
的初始值定义为0
,而不是auto
.值auto
在CSS2.1中不存在,因此在CSS2.1中无效.只需使用min-height: 0
代替:
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;
}
这篇关于最小高度:自动在Opera中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文