I am trying to create multi tab groups with headers using CSS flexbox layout. I'm running into an issue where some elements are not wrapping text in IE11.
I have tried other similar issues discussed on Stack Overflow, by adding weight:100%
to children, or using flex: 1
or flex: 1 auto
, and none of those have resolved the issue.
https://codepen.io/Oboluse/pen/mmNaoR
.tabSection {
display: flex;
}
h3 {
padding: 10px;
border: 1px solid gray;
}
.tabGroup {
display: flex;
align-items: flex-end;
max-width: 100%;
}
.header {
flex: 1 0 auto;
text-align: center
}
.tabGroupParent {
display: flex;
flex-direction: column;
border: 3px solid green
}
.tab {
flex: 0 1 auto;
}
<div class="tabSection">
<div class="tabGroupParent">
<span class="header">header</span>
<div class="tabGroup">
<h3 class="tab">
column value stuff stuff 1
</h3>
<h3 class="tab">
column value stuff stuff 2
</h3>
<h3 class="tab">
column value stuff stuff 3
</h3>
</div>
</div>
<div class="tabGroupParent">
<span class="header">header</span>
<div class="tabGroup">
<h3 class="tab">
column value stuff stuff 4
</h3>
</div>
</div>
</div>
I have noticed if I remove flex-direction: column;
from .tabGroupParent
, then the child elements start wrapping in IE11 but I lose my header. Is there another way to achieve centered header in this case? or how can I get the children elements to wrap in IE11 without removing flex-direction: column
?