4
我想添加背景圖像到一個已經有背景顏色的按鈕(或具有相同類的鏈接)。使用CSS(jsfiddle)添加背景圖像到按鈕
這裏是的jsfiddle:http://jsfiddle.net/BNvke/
按鈕本身看起來不錯,但我試圖讓這個如果我添加一定的階級,填充將被調整和背景圖像將顯示,但圖像不顯示。下面是CSS/HTML:
.button {
padding: 10px;
margin-right: 8px;
margin-bottom:10px;
font-family: Arial, Tahoma, Verdana, FreeSans, sans-serif;
text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);
display: inline-block;
white-space: nowrap;
line-height:1em;
position:relative;
outline: none;
overflow: visible;
cursor: pointer;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius:4px;
box-shadow:1px 1px 2px 0 #CCCCCC;
-moz-box-shadow: 1px 1px 2px 0 #CCCCCC;
-webkit-box-shadow: 1px 1px 2px 0 #CCCCCC;
}
.button_blue {
border: 1px solid #305875;
color: #FBFBFB;
background-color: #3D6E97;
}
.button_blue:hover {
color: #FBFBFB;
opacity:0.9;
filter:alpha(opacity=90);
}
.button_about {
background-image: url(http://i47.tinypic.com/2ni0ahd.png) 3px 5px no-repeat;
padding-left: 35px;
padding-right: 15px;
}
-
<p><a class="button button_blue">Without Background</a></p>
<p><a class="button button_blue button_about">With Background</a></p>
我怎樣才能像背景圖片顯示?
臉色應用於
.button_blue
約background-color
定義的規則太好了謝謝! – JROB 2012-07-09 23:18:28