I have following code
.parent {
display: flex;
width: 100%;
flex-direction: column;
overflow-x: auto;
}
.child {
display: flex;
flex-flow: row nowrap;
background: red;
}
.grand-child {
flex-shrink: 0;
display: block;
align-items: center;
padding: .54rem 1.05rem;
width: 300px;
height: 100px;
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
<div class="parent">
<div class="child">
<div class="grand-child">a</div>
<div class="grand-child">b</div>
<div class="grand-child">c</div>
<div class="grand-child">d</div>
</div>
</div>
Problem:
When a background is applied to the class .children
, the background is not overflowed content (When scrolling through x axis). I want to keep the scrollability as it is while applying the background only to .children
class. If that is not possible what is the reason?
I had this question while answering This. Though I managed to provide a fix for the issue this specific problem still remains