Reputation: 19688
If I have a parent and child div:
<div class="parent">
<div class="content child">1</div>
</div>
The parent div has:
The content children will be:
What CSS is needed on the parent, and each child?
Here is a fiddle with my best attempt.
Upvotes: 0
Views: 3201
Reputation: 172
Using flexbox:
.parent {
display: flex;
overflow-x: scroll;
}
.content {
display: block;
}
Upvotes: 0
Reputation: 54629
To have all elements in a single line you need to make the child elements display inline-block and disable wrapping of white space on the parent
.parent {
max-width: 50%;
overflow-x: scroll;
white-space: nowrap;
}
.content {
display: inline-block;
}
Upvotes: 6