<title>div内容自动带滚动条<title>
<style> * {
margin: 0;
padding: 0;
}
.container {
margin: 100px auto;
width: 200px;
height: 100px;
/* padding-right: 17px; */
/* box-sizing: border-box; */ //注释方便看效果
background-color: #00b83f;
text-align: right;
overflow: auto;
overflow-y: overlay;
}
.inner {
width: 100%;
height: 300px;
background-color: pink;
}

</style>
<div class="container">
<div class="inner">
<h1>我是容器内容<br></h1>
</div>
</div>