我正在尝试将按钮的位置从按钮的当前位置向上或向下更改一些特定数量的像素。你能告诉我如何获得当前位置吗?
谢谢
方法之一:可以使用相对定位
button {
position: relative;
top: 2px;
}
你也可以使用margin-top
button {
margin-top: 2px;
}
您可以简单地使用 margin-top: 2px 或 margin-top: -2px 见http://www.w3schools.com/css/css_margin.asp