I have a simple "table" built with flexbox.
I'd like to scroll a part of it using overflow-x.
As you can see from the sample code, the CSS style is only applied to the initially visible part of the flex item. In the overflown part, the CSS style is not applied. Scroll to the right and you'll see that the background stops where overflow begins.
.data-table {
display: flex;
width: 200px;
}
.data-table__scrollable-data {
overflow-x: auto;
background-color: white;
}
.data-table__row-group {
display: flex;
background-color: #33ccff;
}
.data-table__data-cell {
flex: 1 0 100px;
border-bottom: 1px solid black;
}
<div class="data-table">
<div class="data-table__scrollable-data">
<div class="data-table__row-group">
<div class="data-table__data-cell">Data Cell</div>
<div class="data-table__data-cell">Data Cell</div>
<div class="data-table__data-cell">Data Cell</div>
<div class="data-table__data-cell">Data Cell</div>
<div class="data-table__data-cell">Data Cell</div>
<div class="data-table__data-cell">Data Cell</div>
<div class="data-table__data-cell">Data Cell</div>
<div class="data-table__data-cell">Data Cell</div>
</div>
</div>
</div>