Basic Styling in Buttons in CSS?

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOps School!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

 CSS properties, we can style the buttons. Buttons help us to create user interaction and event processing. They are one of the widely used elements of web pages.During the form submission, to view or to get some information, we generally use buttons.

There are multiple properties available that are used to style the button element. Let’s discuss them one by one.

  • Background-color=  this property is used for setting the background color of the button element.
Syntax
element {  
    // background-color style  
}  
  • border= It is used to set the border of the button. It is the shorthand property for border-width, border-color, and border-style.
Syntax
element {  
    // border style  
}  
  • border-radius= It is used to make the rounded corners of the button. It sets the border radius of the button.
syntax
element {  
    // border-radius property  
}  
  • padding =It is used to set the button padding.
syntax
  1. element {  
  2.     // padding style  
  3. }  

example

<!DOCTYPE html>    
<html>    
    
<head>    
    <title>   
        button background Color   
    </title>   
        
    <style>   
    body{  
       text-align: center;  
    }  
        button {  
           color:lightgoldenrodyellow;  
            font-size: 30px;   
        }   
        .b1 {   
            background-color: red;   
        }   
        .b2 {   
            background-color: blue;   
        }   
        .b3 {   
            background-color: violet;   
        }   
    </style>   
</head>   
    
<body>    
   <h1>The background-color property.</h1>  
    <button class="b1">Red color button</button>   
    <button class="b2">Blue color button</button>   
    <button class="b3">Violet color button</button>   
</body>    
</html>    

output

Related Posts

Finding Your Way Through Urology Hospitals, Specialist Care, and Treatment Pathways: An Educational Patient Guide

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

How to Train With a DevSecOps Trainer for Security-First DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Bihar Tourism Uncovered: An Insider’s Guide to Ancient Sights, Culture, and Local Life

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Unlocking Lucknow: Your Go-To Guide to Local Happenings, Weekend Passes & City Life

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

The Best Knee Replacement Hospitals in India: An Insider’s Guide for Patients

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Events in Kolkata: Ultimate Guide to Tickets, Shows & Things to Do

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x