当我使用'不重复'背景工作时,但只要我改变为'不重复',就没有背景。我试图在CSS中定义背景。背景不显示
body
{ font: normal 80% Arial, Helvetica, sans-serif;
color: #000;
background: #4E5869;
background-image: url(../images/bg_body.jpg) no-repeat;
}
希望你的帮助。
干杯
当我使用'不重复'背景工作时,但只要我改变为'不重复',就没有背景。我试图在CSS中定义背景。背景不显示
body
{ font: normal 80% Arial, Helvetica, sans-serif;
color: #000;
background: #4E5869;
background-image: url(../images/bg_body.jpg) no-repeat;
}
希望你的帮助。
干杯
no-repeat
是background-repeat
值,而不是background-image
值...
background-image: url(...);
background-repeat: no-repeat;
OR:
background: #4E5869 url(...) no-repeat;
为什么不试试这个:
body
{ font: normal 80% Arial, Helvetica, sans-serif;
color: #000;
background-color: #4E5869;
background-image: url(../images/bg_body.jpg);
background-repeat: no-repeat;
}
现在background-color
和background-image
可单独进行投放。
当你调用background
它里面,你可以先打电话给你color
那么你image-url
image-position
和background-repeat
。但是,当你打电话说background-image
然后调用只是image-url
body
{ font: normal 80% Arial, Helvetica, sans-serif;
color: #000;
background-color: #4E5869;
background-image: url(../images/bg_body.jpg);
background-repeat: no-repeat;
}
OR
body
{ font: normal 80% Arial, Helvetica, sans-serif;
color: #000;
background: #4E5869 url(../images/bg_body.jpg) no-repeat;
}
这将工作:
body {
font: normal 80% Arial, Helvetica, sans-serif;
color: #000;
background: #4E5869 url(../images/bg_body.jpg) no-repeat;
}
background-image
是图像,你不希望给任何规则。你可以像你这样的风格:
body {
font: normal 80% Arial, Helvetica, sans-serif;
color: #000;
background: #4E5869;
background-image: url(../images/bg_body.jpg);
background-repeat: no-repeat;
}
几乎相等。 一些东西来读:http://www.w3schools.com/cssref/pr_background-repeat.asp
不能使用不重复为背景图像的部分(全部接受,就是URL的图像)
您需要使用背景重复:
https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat
http://w3fools.com/ –
也许你不喜欢这样的网站 - 但它仍然证明了上述观点,并给出了如何利用这项功能,他举例需要正确的;) –
在这种情况下,也许,但你会做更好的链接到MDN。 –
因为这会不会工作? –
见我解释明白我试图指出 – OmniPotens