防止HTML-div(盒子)增长

时间:2011-09-20 10:33:15

标签: html overflow

我想将div(CSS3框)保持为一定的宽度。但不知何故,溢出:隐藏和最大宽度似乎被忽略。

<html>
<head></head>
<body>
<div style="display:-moz-box;">
  <!-- Keep the red div 100 px wide, regardless of its content. But how? -->
  <div style="background-color:red; padding:2px; width:100px; max-width:100px; overflow:hidden;">
    <div style="width:500px; border: 1px solid yellow;">&nbsp;</div>
  </div>
<div>2</div>
</div>
</body>
</html>

目前正在Firefox 6中进行测试。

1 个答案:

答案 0 :(得分:1)

一些研究发现this错误报告。您可能需要找到另一种方法来实现您想要的目标。

相关问题