我目前的背景设置在右上角:
#thedivstatus {
background-image: url("imagestatus.gif");
background-position: right top;
background-repeat: no-repeat;
}
Run Code Online (Sandbox Code Playgroud)
但!我需要margin-top:50px;通过上面的渲染添加一个.有人能给我一个建议吗?
谢谢
Bol*_*ock 61
如果你的意思是你希望背景图像本身偏离顶部50个像素,就像背景边缘一样,那么只需关闭topfor 50px就可以了.
#thedivstatus {
background-image: url("imagestatus.gif");
background-position: right 50px;
background-repeat: no-repeat;
}
Run Code Online (Sandbox Code Playgroud)
background-image: url(/images/poster.png);
background-position: center;
background-position-y: 50px;
background-repeat: no-repeat;
Run Code Online (Sandbox Code Playgroud)