I am using CSS FlexBox to design my website. (See example below)
In FlexBox, "Flex:1" attribute will make sure all the items in the container are re-sized according to the widest item.
However, in Internet Explorer 10/11 this does not work unless you specify the width of the item. (Using flex-basis). The problem is that once you specify a flex-basis value, it becomes static and no longer shrinks or grows according to the content.
Is there some solution in IE without making the width static?
Thanks!
Example (IE - Bug, Chrome - Correct Behaviour): https://codepen.io/dsomekh/pen/BRoreL
<html>
<style>
.parent{
display: flex;
justify-content:center;
}
.table{
display:flex;
flex-direction:row;
}
.element{
flex:1;
border: 5px solid skyblue;
display:flex;
}
</style>
<div class="parent">
<div class="table">
<div class="element">First element - small.</div>
<div class="element">Second element - contains more text and first element will resize accordingly. How do we acheive this in IE?</div>
</div>
</div>
</div>
</html>