2015-11-19 197 views
-3

body标记中,我添加了一个background-image。但图像重复4次。如何解决只显示一次?Html身体背景图片

HTML代码:

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

CSS代码:现在习惯了这种

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

body{ 
    background-image : no-repeat; 
} 
+0

请尝试在这里发布您的问题之前找到自己的解决办法,如果你我猜这需要几秒钟才能找到这个问题的答案! – Mohammad

回答

1

喜还是该

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

它的背景重复 的身体从身体

body{ 
background-repeat: no-repeat; 
} 
0

去除背景和运用你的CSS像下面。

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

您可以使用style属性添加样式身体标记:

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

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>