In the code below, all is displayed correctly in Chrome. The width of the .inner
element is restricted by max-width
.
In IE11, the .inner
element stretched to all content.
If I set display: block
for .container
or .inner
element all works correctly. But I can't do this because this example is a short reproduction of error in large component that used on many sites and I don't want to break something.
- Why it happens?
- How to fix it?
.container {
background-color: yellow;
display: table;
height: 100px;
max-width: 277px;
}
.inner {
background-color: red;
display: flex;
height: 50px;
}
<div class="container">
<div class="inner">77 777 777 77 7 7777 77 7 7 7 77 7 7 7 77 7 7 7 7 7 77 7 7 7 7 77 7 77 7 7 77 7 7 77 7 7 77 7 7 77 7 7 7 7 7</div>
<div class="inner">111 11111 111111111111 111111111111 111111111 111111111111 11111111111 11111111111 11111111 1111111111 11111</div>
</div>