CSS背景位置右上角

Spe*_*r H 4 html css

我想要 图标 按钮上的背景图像出现在右上角.

我成功background-position: bottom top 100px地将图像移动到顶部,但是我没有成功将图像向右移动.

是否有类似的东西background-position: bottom top 100px, right 900px可能有助于产生预期的结果?

#AddNewMeetingButton {
    position: absolute;
    top: 0;
    text-align: center;
    background-image: url(Images/add_icon_48x48.png);
    background-position: bottom top 100px, right 800px;
    background-repeat: no-repeat;
    height: 190px;
    width: 915px;
    background-color: transparent;
    outline: none;
    border: none;
    z-index: 2;
}
Run Code Online (Sandbox Code Playgroud)

Pau*_*e_D 12

像这样的东西

background-image: url(http://i.stack.imgur.com/cW9aK.png);
background-repeat: no-repeat;
background-size: 48px 48px;
background-position: right 10px top 10px;
Run Code Online (Sandbox Code Playgroud)

JSfiddle演示

MDN参考

background-position:<position> 哪里:

<position>是一到四个值,表示关于元素框边缘的2D位置.可以给出相对或绝对偏移.请注意,可以在元素框的外部设置位置.

所以:

background-position: right 10px top 10px;
Run Code Online (Sandbox Code Playgroud)

将图像置于顶部/右侧,但距离右边缘10px,距顶边缘10px