I am attempting to contain a scrollbar within a div so that it remains within the rounded corners without overflowing. Take a look at the code snippet below to see the problem in action.
Is there a way for the scrollbar to be fixed in its position, while any excess content is neatly cut off by the rounded corners as if it were inside the borders of the div?
div {
margin: 20px;
width: 100px;
height: 200px;
overflow-x: hidden;
overflow-y: scroll;
border: 1px solid black;
border-radius: 30px;
display: inline-block;
}
p {
float: left;
width: 100%;
padding: 10px;
}
<div>
<p>Item 1</p>
<p>Item 2</p>
<p>Item 3</p>
<p>Item 4</p>
<p>Item 5</p>
</div>