Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

แสดงภาพพื้นหลังเพียงครั้งเดียวด้วย CSS


ใช้ พื้นหลัง-ทำซ้ำ คุณสมบัติเพื่อแสดงภาพพื้นหลังเพียงครั้งเดียว คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน background-repeat ทรัพย์สิน −

ตัวอย่าง

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