I have a flex container, and I am trying to make the footer in it be full width, but when the sibling table overflows, the footer is not following the new width of the container, how to overcome that behaviour?
.container {
display: flex;
flex-direction: column;
justify-content: space-between;
flex-wrap: wrap;
border: 1px solid #000;
width: 200px;
height: 100px;
overflow: auto;
}
.footer {
display: flex;
justify-content: center;
width: 100%;
min-width: 0;
background-color: blue;
}
<div class="container">
<table>
<tr>
<td>Text</td>
<td>Text</td>
<td>Text</td>
<td>Text</td>
<td>Text</td>
<td>Text</td>
<td>Text</td>
<td>Text</td>
</tr>
</table>
<div class="footer">
<button>
Load more
</button>
</div>
</div>
3
Answers
Change
width : 100%
tomin-width:100%
.Use CSS grid instead and you will get the behavior you want by default:
Perhaps
position: sticky;
will be useful: