2
I’m using the CSS property flex-wrap in some <div>
so that I can show them or hide them without breaking the fluidity of the layout. However I noticed that when my container is a <fieldset>
, the wrap does not happen in Google Chrome.
Do you have any idea how to render correctly in Chrome?
Or some explanation for this behavior?
If you want to test Here is a Fiddle, below has a snippet, and soon after screenshots of behavior on my machine (Windows 10, Chrome 69.0.3497.100 64-bit, Firefox 62.0 64bit).
[EDIT There is a a repository with the implementation bugs in the 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>
Apparently it is a known bug, but I will be waiting for the answers to serve as a future reference to someone.
– fernandosavio
Hell, I couldn’t fix it with flex at all... Just with float:left. Oh you take the flex. Row and float: left; in the column you solve. Another option is to try Grid to see how it behaves inside the fieldset
– hugocsl
Yes, how bizarre right?! I fell into this problem because bootstrap columns 3 break when you have one
help-text
and they get different heights. Only in this form I divide by sector with fieldset to be able to give adisable
on the whole set with less overhead. Then I got a little crazy with this and I remembered that the guys here can give a hand– fernandosavio