Use CSS to modify HTML button background color

 The default value of the HTML button background color is relatively simple, especially when designing a web page with a special style, the texture is often not good enough, so web designers usually need to modify the HTML button background color to match the overall web page style. The best way to use the background color of the button is the built-in background-color property of CSS. This property is a standard function for modifying the background color of web page elements. It is supported by almost all mainstream browsers. The method of use is also very simple, that is, to modify the background color. Apply background-color to your HTML button, and then select the background color you want to use.


Introduction to Grammar
background-color: Color setting;
CSS background-color can accept RGB color codes, hexadecimal color codes and color English words. The best one is the hexadecimal color code, which is also the most popular method. Designers can use our "Color Code "List" find hundreds of colors to apply.

Actual application example
<input type="button" style="background-color:#FFF0D4" value="This is the button with the background color #FFF0D4"><br>
<input type="button" style="background-color:#FFFF78" value="This is the button with the background color #FFFF78"><br>
<input type="button" style="background-color:#FFD4D4" value="This is the button with the background color #FFD4D4"><br>
<input type="button" style="background-color:#C9FFC9" value="This is the button with the background color #C9FFC9"><br>
<input type="button" style="background-color:#C2C2FF" value="This is the button with the background color #C2C2FF">
Example effect




In the example, we have prepared several HTML buttons with different background colors, all of which are modified through the CSS background-color property. Readers should have noticed that the syntax of each button is almost the same, the biggest difference The color code used is different, which is also a convenient part of CSS. After the button applies the background-color property, we can easily select a variety of different colors in the "color code table" to modify the button background Color, so you can have many colorful button effects.

Post a Comment

0 Comments