Make Child Div Overflow Inside Parent Div?
I've looked a dozens of questions and answers and searched for hours and I cannot find any information on this specific scenario. So I have a parent div with a child div inside it.
Solution 1:
#parentDiv {
background: red;
height: 200px;
overflow-y: scroll;
}
#childDiv {
background: green;
}
<fieldset id='parentDiv'>
<div id='childDiv'>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
<p>some text yo</p>
</div>
</fieldset>
You need to add overflow to the parent: overflow-y: scroll;
Post a Comment for "Make Child Div Overflow Inside Parent Div?"