簡體   English   中英

Html 正文背景圖片

[英]Html Body Background Image

body標簽中,我添加了一個background-image 但是圖像重復了 4 次。 如何修復它以僅顯示一次?

HTML代碼:

<body background="image.png"></body>

CSS代碼:

body{
    background-image : no-repeat;
}

它是background-repeat

body{
   background-repeat: no-repeat;
}

您可以使用 style 屬性為 body 標簽添加樣式:

<body style="background-image:url('image.png');background-repeat: no-repeat;">

嗨,現在習慣了

body{background:url('image.png') no-repeat};

或這個

body{
   background-image:url('image.png'); // for your body background
   background-repeat: no-repeat;      // for your body  background repeat 
}

從正文中刪除背景並應用您的 CSS,如下所示。

body
{
  background-image:url('image.png');
  background-repeat:no-repeat;
}

 html { background: url(http://p1.pichost.me/i/64/1886374.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }
 <html> <body> </body> </html>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM