仅用 CSS 显示背景图片一次


使用 background-repeat 属性仅显示背景图片一次。你可以尝试运行以下代码来实现background-repeat 属性 −

示例

在线演示

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

更新于: 30-6-2020

675 次浏览

开启你的 职业生涯

通过完成课程来进行认证

立即开始
广告