Reputation:
I am having a css issue with fieldset and wonder if you could help?
I have a fieldset with width smaller than its content div's width.
I want the fieldset to display a horizontal scroll bar as the content is too wide but it only works in IE's not Firefox.
Thanks in advance.
Eric
This is the html
<fieldset style=" width:150px; overflow:scroll;" >
<div style="width:200px; height:50px; background:red;">
Contents...
</div>
</fieldset>
Upvotes: 4
Views: 7705
Reputation: 589
I had the same problem. FF does not allow overflow: hidden on fieldset tags regardless if you use overflow-y or overflow-x. My fix was using '-moz-hidden-unscrollable'. Like this...
fieldset{
overflow: -moz-hidden-unscrollable;
}
It is a dirty hack but it works.
re: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#Values
Upvotes: 0
Reputation: 49487
As others have already mentioned, this is a bug in Firefox: Bug 261037 - overflow property not implemented on fieldset (reported in 2004, and still not fixed)
Upvotes: 0
Reputation: 101123
The best thing I can come up with is to put 2 nested divs within the fieldset:
<fieldset style="width:150px" >
<div style="width: 150px; overflow-x:scroll;">
<div style="width:200px; height:50px; background:red;">
Contents...
</div>
</div>
</fieldset>
Upvotes: 6
Reputation: 58301
Try this:
<fieldset style=" width:150px;">
<div style="width:200px; height:50px; background:red; overflow:scroll;">
Contents...
</div>
</fieldset>
Upvotes: 0