将背景图片向下推

5
我有以下的css代码,它将一张图片放置在页面背景顶部:
body {
    background:url("http://intranet/img/background-top.png") repeat-x top;
}

是否可以将此图像向下推大约50像素?

2个回答

16

是的:

body {
    background: url(whatever) repeat-x 0px 50px;
}

或:

body {
    background-image: url(whatever);
    background-position: 0px 50px;
    background-repeat: repeat-x;
}

3
body {
    background:url("http://intranet/img/background-top.png") repeat-x left 50px;
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接