我已經創建了一個圖像來說明我的問題:圓形按鈕 - 如何STRETCH時裏面的文字全寬
正如你所看到的。我有一個大的圓形按鈕。它由3個圖像組成。一張圖片在右側,另一張在左側,另一張在中間。
左右圖像相當寬,因爲按鈕中有一個漸變,所以我不能讓它們只有5px寬。現在的問題是,裏面的文本僅限於中間區域。我希望它橫跨整個按鈕。
這裏是我的風格:
#index-navigation ul li a {
height: 96px;
line-height: 96px;
text-decoration: none;
font-weight: bold;
font-size: 1em;
color: #333;
background: url('/images/[email protected]') right center no-repeat;
padding-right: 100px;
}
#index-navigation ul li a span.left {
background: url('/images/[email protected]') left center no-repeat;
padding-left: 100px;
}
#index-navigation ul li a span.middle {
background: url('/images/[email protected]') left center repeat-x;
}
如何編輯風格能有錨採取按鈕的整個寬度?就像這樣:
爲什麼不這樣做呢? http://jsfiddle.net/Qc9cU/2/ –
@EricFortis,可能是因爲圖像不僅僅是一個圓形的邊框? – Qtax