我有兩個按鈕,我想用 V 形替換。
(https://fontawesome.com/icons/chevron-right?s=solid&f=classic)
.button { visibility:hidden }
.button:after { visibility:visible; content:'>'; font-size: ~ 30px }
我就是這樣做的。
但我寧愿用影像/svg 替換按鈕,而不是普通的“>”字符。
有什么解決辦法嗎?
uj5u.com熱心網友回復:
您可以使用background-image您的.button:after方法或嘗試以下方法。
button {
border: none;
background-color: transparent;
}
<button onClick='alert("clicked");'>
<img src="https://cdn0.iconfinder.com/data/icons/merry-christmas-41/512/37-christmas-wreath-decoration-1024.png" width="48"/>
</button>
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/525391.html
標籤:htmlcss
下一篇:如何使用CSS制作圓角邊框?
