如何使用 CSS 給按鈕新增彩色邊框?
要新增彩色邊框,請使用 border CSS 屬性。
示例
你可以嘗試執行以下程式碼以新增彩色邊框。
即時演示
<!DOCTYPE html> <html> <head> <style> .button { background-color: yellow; color: black; text-align: center; font-size: 15px; padding: 20px; border-radius: 15px; border: 3px dashed blue; } </style> </head> <body> <h2>Result</h2> <p>Click below for result:</p> <button class = "button">Result</button> </body> </html>
廣告