.page {
margin: 10px auto;
max-width: 500px;
}
.grid {
display: grid;
grid-template-columns: 100px auto;
grid-gap: 10px;
margin: 0 10px;
}
.sidebar {
border: 1px solid green;
}
.widget {
border: 1px solid red;
}
.timeline {
width: 100%;
overflow-x: scroll;
overflow-y: hidden;
background-color: white;
}
.timebar {
width: 1000px;
}
<div class="page">
<div class="grid">
<div class="sidebar">sidebar</div>
<div class="main">
<div class="widget">
<div class="timeline">
<div class="timebar">5pm</div>
</div>
</div>
</div>
</div>
</div>
How can I prevent the .timeline
from stretching the .widget
?
The timeline has overflow-x: scroll
on it; I was hoping that would allow the content to scroll instead of stretching the parent div. How can I fix this?