Change Button Color In HTML

In this article I will explain how to change color of your button in HTML.
  • 16708

Introduction

In this article I will explain how to change color of your button in HTML. We can change the color of Submit button and its text also. We can do this by applying two properties i.e. background-color and color to the button.

Example

<!DOCTYPE html >

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Change Button Color in HTML</title>

</head>

<body>

  <h2>Change Button Color in HTML</h2>

<form action="https://dotnetheaven.com" method="post">

Comments:<br /><br />

  <textarea name="comments" id="comments" style="width:160px;height:100px;background-color:#D0F18F;font:16px/24px cursive">

  Do Comment Here....!

  </textarea><br />

  &nbsp;   <p>

  <input type="submit" value="Submit" style="background-color:#53760D;color:#D0F18F" /></p></form>

</body>

</html>

 

Output:


ChangeButtonColor_HTML.jpg

 

Now click on Submit button.

 

ChangeButtonColor_HTML01.jpg

© 2020 DotNetHeaven. All rights reserved.