我製作了一些css按鈕,並且希望在文本「Button Text」之前添加一個圖標。HTML/CSS - 在按鈕上添加一個圖標
但我不知道我應該怎麼做這個...
HTML <div class="btn btn_red"><a href="#">Crimson</a><span></span></div>
CSS
body {
margin: 0;
padding: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
}
/* Glassy Buttons */
.btn {
float: left;
clear: both;
background: url(imgs/button_left.png) no-repeat;
padding: 0 0 0 10px;
margin: 5px 0;
}
.btn a{
float: left;
height: 40px;
background: url(imgs/button_middle.png) repeat-x left top;
line-height: 40px;
padding: 0 10px;
color: #fff;
font-size: 1em;
text-decoration: none;
}
.btn span {
background: url(imgs/button_right.png) no-repeat;
float: left;
width: 10px;
height: 40px;
}
.btn_gray {background-color: #808080;}
.btn_green { background-color: #ADFF2F;}
.btn_blue {background-color: #0000CD;}
.btn_red {background-color: #DC143C;}
傑夫T是正確的。 – jessegavin 2010-08-16 02:28:16
非常感謝你! – user377419 2010-08-16 15:34:28
也許你想嘗試使用font-awesome的更新/更清晰的方法。在下面檢查我的答案。 – vohrahul 2017-02-03 13:14:41