我試圖使用css'滑動門'技術來設計按鈕樣式,但它無法正常工作。我目前只能訪問firefox 3,所以這個問題可能不會發生在其他瀏覽器,但我想解決它的Firefox。Css按鈕滑動門
這裏的問題是什麼圖片:
http://img131.imageshack.us/img131/3559/buttons.png
正如你所看到的第二面比第一由像素較低,還沒有結束的權利不夠。以下是我正在使用的代碼:
button
{
font-weight: bold;
border: none;
background: top left url(../images/blue_button_left.gif) no-repeat #24AADF;
color: #FFFFFF;
height: 25px;
}
button span
{
display: block;
height: 25px;
background: top right url(../images/blue_button_right.gif) no-repeat;
position: relative;
}
<a href="http://localhost"><button class="important" type="button"><span>Register</span></button></a>
<button type="submit"><span>Submit</span></button>
如何解決此問題?我試着用top:-1px right:-3px來相對定位跨度,但是文本不對齊。
謝謝。
它實際上需要是一個按鈕標籤,因爲它需要提交表單。 – Zim 2009-07-30 12:31:59
爲什麼你不使用這個並通過JavaScript sumbit表單? – Vnuk 2009-07-30 12:37:32
只需拿起代碼並將其更改爲適合您的需求即可。我使用了一個div類而不是,它工作。我認爲你的問題在於填充。您需要將適當的填充左側和填充右側設置爲較小圖像的大小。 或者做什麼@Vnuk說。 – Martin 2009-07-30 12:40:38