我試圖用按鈕背景替換我的應用程序上的鏈接。但是,鏈接文本不會在水平方向居中居中。我正在使用屬性「background-position:center center;」我認爲這將解決我的問題。CSS如何正確替換按鈕背景的鏈接
我的HTML:
<a class="violetButtonLarge" href="#">My Link</a>
CSS:
.violetButtonLarge {
display: block;
width: 304px;
height: 41px;
background: url(../images/violetButton_large.png) no-repeat center center;
border:none;
color: #FFFFFF;
font-weight: bold;
font-family: Arial;
background-color: transparent;
text-decoration: none;
}
我的形象:
什麼我我做錯了什麼?這就是我得到:
提前感謝!
你應該把它扔上的jsfiddle,這樣我們就可以用它玩。 –