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.