Please take a look at this snippet:
table {
background-color: yellow;
box-shadow: inset 0 0 1px red;
max-width: 100%;
}
td {
background-color: lightgreen;
box-shadow: inset 0 0 1px blue;
max-width: 100%;
}
.flex {
max-width: 100%;
display: flex;
flex: 1;
background-color: lightblue;
box-shadow: inset 0 0 1px black;
flex-wrap: wrap;
}
.box {
width: 50%;
background-color: cyan;
border-radius: 9px;
box-shadow: inset 0 0 1px red;
}
<table>
<tr>
<td>
<div class="flex">
<div class="box">
123456789ABCDEFGHIJKL
</div>
<div class="box">
meeedium
</div>
<div class="box">
short
</div>
</div>
</td>
</tr>
</table>
Run codeHide result (Here is the code if you want to play with it more easily: http://codepen.io/anon/pen/MKJmBM )Please note that the text in the upper left boxdoes not fully fit into it. (At least in Chrome, this is not so.) I assumed that the packing table would try to “push” its width so that its contents fit completely into itself. So is this an implementation error? Or unspecified behavior? Or is my code just messed up?
Can someone explain this behavior and provide a solution to fix it?
(... , : CSS, "" , " , " ;)
: " " . , , , max-width: 50%; .box, , . : , ?
, " ": , , , .