Skip to content
doubtly

1 answer

 

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  background-color: #4CAF50; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}
 
.buttondemo {background-color: #008CBA;} /* Blue */
.buttondemo2 {background-color: #f44336;} /* Red */ 
.buttondemo3 {background-color: #e7e7e7; color: black;} /* Gray */ 
.buttondemo4 {background-color: #555555;} /* Black */
</style>
</head>
<body>
 
<h2>Button Colors</h2>
<p>Change the background color of a button with the background-color property:</p>
 
<button class="button">Green</button>
<button class="button buttondemo">Blue</button>
<button class="button buttondemo2">Red</button>
<button class="button buttondemo3">Gray</button>
<button class="buttonbuttondemo4">Black</button>
 
</body>
</html>
 
codelikepro · 19 Aug 2022 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.