I'm using the CSS property flex-wrap in some <div>
so I can show them or hide them without breaking the flow of the layout. But I noticed that when my container is a <fieldset>
, wrap does not happen in Google Chrome.
Do you have any idea how to render correctly in Chrome?
Or any explanation for this behavior?
If you want to test here is a Fiddle , below you have a snippet, and soon after screenshots of the behavior on my machine ( Windows 10, Chrome 69.0.3497.100 64 bit, Firefox 62.0 64bit).
[ EDIT There is a repository with implementation bugs in browsers.]
/* vvv apenas para melhor apresentação vvv */
*, :before, :after { box-sizing: border-box;}
.content {
border: 1px solid lightblue;
padding: 5px;
}
fieldset {
margin: 0;
padding: 0;
border: none; min-width: 0;
}
/* ^^^ apenas para melhor apresentação ^^^ */
.row {
display: flex;
flex-wrap: wrap;
}
.row > .column {
width: 50%;
padding: 5px;
}
<h3><div></h3>
<div class="row">
<div class="column">
<div class="content">child</div>
</div>
<div class="column">
<div class="content">child</div>
</div>
<div class="column">
<div class="content">child</div>
</div>
<div class="column">
<div class="content">child</div>
</div>
</div>
<h3><fieldset></h3>
<fieldset class="row">
<div class="column">
<div class="content">child</div>
</div>
<div class="column">
<div class="content">child</div>
</div>
<div class="column">
<div class="content">child</div>
</div>
<div class="column">
<div class="content">child</div>
</div>
</fieldset>
Firefox Screenshot
ChromeScreenshot