用 CSS 更改按鈕的背景顏色
若要更改按鈕的背景顏色,請使用 background-color 屬性。
你可以嘗試執行以下程式碼來更改按鈕的背景顏色
示例
<!DOCTYPE html> <html> <head> <style> .btn { background-color: yellow; color: black; text-align: center; font-size: 13px; } </style> </head> <body> <h2>Result</h2> <p>Click below for result:</p> <button class = "btn">Result</button> </body> </html>
廣告