【发布时间】:2011-07-20 22:06:59
【问题描述】:
1-simple(width and height)和max/min(width and height)有什么区别?解释如果元素的内容、宽度和高度(宽度和高度)或最大/最小(宽度和高度)已经在内部样式中指定,增长超过指定值会发生什么?
2-其次,我们如何知道何时使用哪一个?(简单或最大/最小)
3-在以下示例中:
<html>
<head>
<style type="text/css">
p
{
max-height:50px;
background-color:yellow;
}
</style>
</head>
<body>
<p>The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
The maximum height of this paragraph is set to 50px.
</p>
</body>
</html>
这里,max-height似乎对内容没有影响
元素的高度随着它的内容而增长和缩小?我目前正在使用 IE8。
【问题讨论】:
-
三题合一;您可以分别作为每个人来快速简短地回答。 :)
-
第一个问题的措辞似乎很像家庭作业......? o_O
-
Width和Max-Width在这个SO question中有详细讨论