CSS overflow-x


CSS overflow-x 允许你决定内容左右两侧的外观。

实例

你可以尝试运行以下代码来实现 overflow-x 属性

在线演示

<!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>

输出

更新于: 30-Jun-2020

245 次浏览

开启你的职业生涯

通过完成课程获取认证

立即开始
广告
© . All rights reserved.