- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to style outline buttons with CSS?
Following is the code to style outline buttons with CSS −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> button { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; border: none; color: white; font-weight: bolder; padding: 20px; font-size: 20px; cursor: pointer; border-radius: 6px; width: 140px; } .Success { border:2px solid #4caf50; color:#4caf50 } .Success:hover { background-color: #46a049; color:white; } .Info { border:2px solid #2196f3; color:#2196f3; } .Info:hover { background: #0b7dda; color:white; } .Warning { border:2px solid #ff9800; color:#ff9800; } .Warning:hover { background: #e68a00; color:white; } .Danger { border:2px solid #f44336; color:#f44336; } .Danger:hover { background: #da190b; color:white; } .Default { border:2px solid #e7e7e7; color: black; } .Default:hover { background: #ddd; } </style> </head> <body> <h1>Alert Buttons Example</h1> <button class="Success">Success</button> <button class="Info">Info</button> <button class="Warning">Warning</button> <button class="Danger">Danger</button> <button class="Default">Default</button> </body> </html>
Output
The above code will produce the following output −
When hovering over the buttons the button background color will be the same as the outline as shown −
- Related Articles
- How to style "alert" buttons with CSS?
- How to style download buttons with CSS?
- How to style text buttons with CSS?
- How to style round buttons with CSS?
- How to style social media buttons with CSS?
- How to style block buttons (full-width) with CSS?
- Set outline style as ridge with CSS
- CSS outline-style property
- Set outline style as a groove with CSS
- Set outline style as a dotted line with CSS
- Set the line style for the outline with CSS
- Set outline style as two solid lines with CSS
- Set outline style as a dashed line with CSS
- The outline-style Property in CSS
- Set outline style as a solid single line with CSS

Advertisements