僅用 CSS 顯示背景圖片一次


使用 background-repeat 屬性僅顯示背景圖片一次。你可以嘗試執行以下程式碼來實現background-repeat 屬性 −

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         body {
            background-image: url("https://tutorialspoint.tw/videotutorials/images/tutor_connect_home.jpg");
            background-repeat: no-repeat;
         }
      </style>
   </head>
   <body>
      <h1>Background Image</h1>
   </body>
</html>

更新於: 30-6-2020

675 次瀏覽

開啟你的 職業生涯

透過完成課程來進行認證

立即開始
廣告