代码示例:(标识:css_overflow_auto)
<!DOCTYPE html>
<html>
<head>
<style>
div {
  background-color: #eee;
  width: 200px;
  height: 50px;
  border: 1px dotted black;
  overflow: auto;
}
</style>
</head>
<body>

<h1>CSS 溢出</h1>

<p>值 auto 类似 scroll,只是在必要时添加滚动条:</p>

<div>当您想更好地控制布局时,可以使用 overflow 属性。overflow 属性规定如果内容溢出元素框会发生什么情况。</div>

</body>
</html>
运行结果: