CSS overflow-y


CSS overflow-y 可确定内容顶部和底部的布局。你可以尝试运行以下代码来实现 overflow-y 属性 -

示例

动态演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            background-color: orange;
            width: 250px;
            height: 45px;
            border: 2px solid blue;
            overflow-x: hidden;
            overflow-y: scroll;
         }
      </style>
   </head>
   <body>
      <h1>Heading</h1>
      <div>Overflow property used here. This is a demo text to show the working of CSS overflow-x and overflow-y.</div>
   </body>
</html>

输出

更新于: 2020-06-22

188 次浏览

开启你的 职业

完成课程即可获得认证

开始学习
广告
© . All rights reserved.