I'm trying to use display: table
with fieldset, but it's not scaling properly. The same thing works if I change <fieldset>
to <div>
.
I tried with Safari and Firefox.
Am I missing something?
I'm trying to use display: table
with fieldset, but it's not scaling properly. The same thing works if I change <fieldset>
to <div>
.
I tried with Safari and Firefox.
Am I missing something?
The fieldset is an element with special behavior, so it is likely for this issue to occur.
Add another div wrapper inside your fieldset wrapper, and use the div. Change fieldset back to normal, or block.
When you change the width of the
fieldset
, you are changing thesize
of theborder
of it. Its function is to group elements and draw a border around them. Its size doesn't affects the content inside it. So, follow this.Basically, the default rendering of fieldset can't actually be expressed in CSS. As a result, browsers have to implement it in non-CSS terms, and that interferes with application of CSS to the element.
Pretty much any element that can't be recreated using pure CSS will have issues of that sort.