源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <style> .button { background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } </style> </head> <body> <h2>CSS 按鈕</h2> <button>默認按鈕</button> <a href="#" class="button">鏈接按鈕</a> <button class="button">按鈕</button> <input type="button" class="button" value="輸入框按鈕"> </body> </html>
運行結果