Why can’t be flex containers?

I tried to style a fieldset element with display: flex and display: inline-flex.

However, it didn’t work: flex behaved like block, and inline-flex behaved like inline-block.

This happens both on Firefox and Chrome, but strangely it works on IE.

Is it a bug? I couldn’t find that fieldset should have any special behavior, neither in HTML5 nor in CSS Flexible Box Layout specs.

fieldset, div {
    display: flex;
    border: 1px solid;
}
<fieldset>
    <p>foo</p>
    <p>bar</p>
</fieldset>
<div>
    <p>foo</p>
    <p>bar</p>
</div>

7 Answers
7

Leave a Comment