mh123
mh123

Reputation: 1

Prevent HTML-div (box) from growing

I'd like to keep a div (a CSS3 box) to a certain width. But somehow, overflow:hidden and max-width seem to be ignored.

<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>

Currently testing in Firefox 6.

Upvotes: 0

Views: 731

Answers (1)

Gareth
Gareth

Reputation: 5719

A bit of research uncovered this bug report. You may need to find another way of doing what you want for the moment.

Upvotes: 1

Related Questions