好的。我想创建DIV其中:
1是一样大的文本是
2,但它有它的最小尺寸和最大一个如何让div像
并告诉我,为什么这条线的CSS让我的高度,最大高度,而不是文字大小或最小高度?
div#me{max-height:40%;min-height:20%;background-color:silver;}
全码:
<head>
<meta http-equiv="Content-Language" content="pl" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<html>
<style type="text/css">
html {width:100%;height:100%;}
html div{margin-left:3%;margin-top:1%;width:94%;height:100%;background-color:black;}
div#me{max-height:40%;min-height:20%;background-color:silver;}
</style>
<div>
<div id="me">
TEXT<br/>
TEXT<br/>
</div>
</div>
</html>
您需要为您的问题添加更多信息。你给出的代码是这样的:http://jsfiddle.net/thirtydot/q7q88/ - 尝试创建你自己的代表你的问题的jsFiddle测试用例。 – thirtydot 2011-03-20 21:30:16
我想将高度设置为最小的可能性而不切割文本,但是我会将div的大小设置为尽可能大(最大高度)。 http://jsfiddle.net/bgtJk/ – oneat 2011-03-20 21:39:37