繁体   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