Wednesday, June 14, 2017

How to change the button border color using HTML and CSS

How to change the button border color using HTML and CSS

Colored Border Buttons

Change the buttons border color using the border property


Sample code: To Change Buttons Border Color


<!DOCTYPE html>
<html>
<head>
<style>
    .button
    {
        border: none;
        color: white;
        padding: 14px 28px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 14px;
        margin: 4px 2px;
        cursor: pointer;
    }

    .button1 { background-color: white; color: black; border: 2px solid red; }
    .button2 { background-color: white; color: black; border: 2px solid green; }
    .button3 { background-color: white; color: black; border: 2px solid blue; }
    .button4 { background-color: white; color: black; border: 2px solid orange; }
    .button5 { background-color: white; color: black; border: 2px solid black; }
</style>
</head>
<body>
    <h2>Colored Border Buttons</h2>
    <p>Change the buttons border color using the border property</p>
    <button class="button button1">Red</button>
    <button class="button button2">Green</button>
    <button class="button button3">Blue</button>
    <button class="button button4">Yellow</button>
    <button class="button button5">Orange</button>
</body>
</html>

No comments:

Post a Comment