我有以下css来设置按钮和锚标签的样式,因为它们具有相同的按钮样式但它们位于不同的位置.所以我想给他们相同的CSS,这样他们都会呈现完全相同的.但是,button.enter的文字被按下了.第一个工作正常.它可以使用填充:0但这会影响第一个.有任何想法吗?
a.enter, button.enter {
text-decoration: none;
background: url('../img/enter-button_small.png') no-repeat 0px 0px;
height: 35px;
padding: 8px 0;
text-align: center;
color: white;
margin: 0 auto;
text-shadow: none;
font-size: 16px;
width: 300px;
vertical-align: middle;
}
Run Code Online (Sandbox Code Playgroud)
只需添加另一种样式,仅重置按钮上的填充.你的一些CSS也是不需要的.vertical-align:middle;例如,在这种情况下什么也不做.
a.enter, button.enter {
text-decoration: none;
background: url('../img/enter-button_small.png') no-repeat 0px 0px;
height: 35px;
padding: 8px 0;
text-align: center;
color: white;
margin: 0 auto;
text-shadow: none;
font-size: 16px;
width: 300px;
}
button.enter {
padding:0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2402 次 |
| 最近记录: |