Wednesday, June 14, 2017

How to change the size of HTML button using Padding

How to change the size of HTML button using Padding

Button Sizes

Change the size of a button using the padding property


Sample code: Change The Size of HTML Button Using Padding


<!DOCTYPE html>
<html>
<head>
<style>
    .button
    {
        background-color: red;
        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 { padding: 12px 24px; }
    .button2 { padding: 16px 32px; }
    .button3 { padding: 20px 40px; }
    .button4 { padding: 18px; }
</style>
</head>
<body>
    <h2>Button Sizes</h2>
    <p>Change the size of a button using the padding property</p>
    <button class="button button1">12px 24px</button>
    <button class="button button2">16px 32px</button>
    <button class="button button3">20px 40px</button>
    <button class="button button4">18px</button>
</body>
</html>

No comments:

Post a Comment