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

PR Points Calculator : The Ultimate Guide to Immigration Eligibility Around the World

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 Complete Guide to Certified FinOps Professional: Career Path, ROI, and Technical Mastery

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

Certified FinOps Manager: The Complete Guide to Mastering Cloud Value and Career Growth

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

Certified FinOps Engineer Career Path for Engineers and Managers

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

Certified FinOps Architect: Strategic Cloud Optimization and Financial Governance

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

Mastering Data Pipelines: The Complete Career Guide to CDOM – Certified DataOps Manager

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