【发布时间】:2013-12-02 10:39:55
【问题描述】:
我怎样才能只在我的网站布局上重复我的背景图片。我的图像宽 1 像素,高 400 像素,我希望它是屏幕宽度的 100%。
我以为是……
CSS:
#bg-image {
background-image: url("images/bg.png")
background-repeat:repeat-y;
background-size: 100%;
}
HTML:
<div class="wrapper">
<div class="bg-image">
</div>
</div>
但这不起作用。我查看了其他 StackOverflow 答案,但找不到与我的问题类似的答案。任何有帮助的赞赏欢呼
【问题讨论】:
-
改变背景-repeat:repeat-x
-
body { background: url(../images/bg.png); }
标签: html css image background repeat