توضیح:
این تگ دارای یک تگ باز و بسته است و قابل کلیک کردن بر روی آن است.
درون این تگ می توان متن و سایر تگ ها مانند br, i, strong و … را قرار داد.
در حالت تگ input این امکان وجود ندارد.
بهتر است در این تگ نوع یا type آن را مشخص کنیم.
خصوصیات این تگ:
نام خصوصیت |
---|
autofocus |
disabled |
form |
formaction |
formenctype |
formmethod |
formnovalidate |
formtarget |
name |
type |
value |
وضعیت پشتیبانی از مرورگرها:
مرورگر Chrome | مرورگر Firefox | مرورگر Edge | مرورگر Safari | مرورگر Opera |
---|---|---|---|---|
همگی | همگی | همگی | همگی | همگی |
مثال:
1 |
<button type="button">Click Me!</button> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
<!DOCTYPE html> <html> <head> <style> .button { border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } .button1 { background-color: white; color: black; border: 2px solid #4CAF50; } .button1:hover { background-color: #4CAF50; color: white; } .button2 { background-color: white; color: black; border: 2px solid #008CBA; } .button2:hover { background-color: #008CBA; color: white; } </style> </head> <body> <button class="button button1">Green</button> <button class="button button2">Blue</button> </body> </html> |