[英]Html Body Background Image
In body
tag, I added a background-image
.在body
标签中,我添加了一个background-image
。 But the image is repeated 4 times.但是图像重复了 4 次。 How to fix that to display it only single time?如何修复它以仅显示一次?
HTML code: HTML代码:
<body background="image.png"></body>
CSS code: CSS代码:
body{
background-image : no-repeat;
}
It's background-repeat
body它是background-repeat
体
body{
background-repeat: no-repeat;
}
您可以使用 style 属性为 body 标签添加样式:
<body style="background-image:url('image.png');background-repeat: no-repeat;">
hi now used to this嗨,现在习惯了
body{background:url('image.png') no-repeat};
or this或这个
body{
background-image:url('image.png'); // for your body background
background-repeat: no-repeat; // for your body background repeat
}
Remove background from body and apply your CSS like below.从正文中删除背景并应用您的 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.