Home > Article > Web Front-end > How to add a colored border to a button using CSS?
To add a colored border, use the CSS border property.
You can try running the following code to add a colored border.
<!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>
The above is the detailed content of How to add a colored border to a button using CSS?. For more information, please follow other related articles on the PHP Chinese website!