Reputation: 15016
I have a fieldset that looks like this:
<fieldset>
<input><label>tada</label>
<input><label>tada</label>
</fieldset>
fieldset{
overflow: hidden;
height: 20px;
}
input{
display: block
}
Js-fiddle:
how come the fieldset shows all it's containing elements, whilst if I change the fieldset to a div: http://jsfiddle.net/GWdWy/2/
the overflow hidden works.
Upvotes: 2
Views: 2028
Reputation: 589
I had the same issue. Firefox does not seem to 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: 2
Reputation: 374
The fieldset has padding applied by the default browser css settings.
Use a CSS Reset to make sure the defaults are equalised in all browsers and elements.
Check the most used one - Eric Meyer's reset: http://meyerweb.com/eric/tools/css/reset/
in your first fiddle set following css for the Fieldset:
fieldset{
overflow: hidden;
height: 20px;
padding: 0;
margin: 0;
border: none;
}
and this will equalize the display. For Firefox a workaround can be found here: Fieldset contents overflow in Firefox
Upvotes: -2