- 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 add a colored border to a button with CSS?
To add colored border, use the CSS border property.
Example
You can try to run the following code to add a colored border.
Live Demo
<!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>
- Related Articles
- With CSS add transparency to a button
- How to add a border to an image with CSS?
- How to add rounded corners to a button with CSS?
- How to add a button to an image with CSS?
- How to create a "button group" with CSS?
- How to create a "more" button with CSS?
- How to create a search button with CSS?
- Add a pressed effect on button click with CSS
- How to create a vertical "button group" with CSS?
- How to create a split button dropdown with CSS?
- How to create a "scroll back to top" button with CSS?
- Add special colored corner to body or text in CSS
- How to center a button element vertically and horizontally with CSS?
- How to create a "toggle switch" (on/off button) with CSS?
- How to Add CSS Rules to a Stylesheet with JavaScript?

Advertisements