背景位置,margin-top? [英] Background position, margin-top?

查看:132
本文介绍了背景位置,margin-top?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前将背景设置为右上角:

I currently have my background set to top right as:

#thedivstatus {
    background-image: url("imagestatus.gif");
    background-position: right top;
    background-repeat: no-repeat;
}

BUTTTTTT! 我需要添加一个 margin-top:50px; 从上面的渲染。有人能给我一个建议吗?

BUTTTTTT! I need to add a margin-top:50px; from where its rendering via above. Could anyone give me a suggestion?

感谢

推荐答案

如果您想要背景图片本身从顶部偏移50像素,像背景边距,然后只需切换顶部 50px

If you mean you want the background image itself to be offset by 50 pixels from the top, like a background margin, then just switch out the top for 50px and you're set.

#thedivstatus {
    background-image: url("imagestatus.gif");
    background-position: right 50px;
    background-repeat: no-repeat;
}

这篇关于背景位置,margin-top?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆