- 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 text buttons with CSS?
Following is the code to style text buttons with CSS −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> button { border: none; color: white; font-weight: bolder; padding: 20px; font-size: 18px; cursor: pointer; border-radius: 6px; } .Success { color: #4caf50; } .Success:hover { background: #e7e7e7; } .Info { color: #2196f3; } .Info:hover { background: #e7e7e7; } .Warning { color: #ff9800; } .Warning:hover { background: #e7e7e7; } .Danger { color: #f44336; } .Danger:hover { background: #e7e7e7; } .Default { color: black; } .Default:hover { background: #e7e7e7; } </style> </head> <body> <h1>Text 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 −
- Related Articles
- How to style "alert" buttons with CSS?
- How to style outline buttons with CSS?
- How to style download 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?
- How to create fading buttons with CSS?
- How to create loading buttons with CSS?
- How to create pill buttons with CSS?
- How to create notification buttons with CSS?
- How to create icon buttons with CSS?
- How to Create Text Reveal Effect for Buttons using HTML and CSS?
- How to style images with CSS?
- How to style labels with CSS?
- How to create "next" and "previous" buttons with CSS?

Advertisements