Use CSS to modify the HTML button text color

 The default button text color of HTML button is usually black. It does not mean that black button text color is not good, but sometimes, when a web designer designs a unique overall page, the text color on the button is also It should be presented with the overall web design. How to modify the button text color of the HTML button ? Web designers can use the text color provided by CSS to modify the attributes, that is, color to make such a design. Let's take a look at the two key basic syntaxes first, and then apply them together in the example to see the effect.


Basic syntax

HTML button button syntax (for detailed usage please refer to: HTML button button )
<input type="button" value="button name">
CSS text color color syntax (for detailed usage, please refer to: CSS color text color )
color: color;
With the above two grammars, we can apply them together. Please see the actual application of the example.

Use CSS to modify HTML button text color example
<input type="button" value="blue button text" style="color:blue;">
<input type="button" value="red button text" style="color:red;">
< input type="button" value="green button text" style="color:green;">
Example output
  
The example is a simple way to use CSS to modify the text color of the HTML button . In the syntax of the button, add style to declare that a CSS style is to be displayed. The color is used to set the color of the button text to be displayed, such as blue (color: blue;), red (color:red) and green (color:green), these are just simple examples. The color property can also be set in other different ways. You can see from the content of the CSS color text color " article More detailed.

Post a Comment

0 Comments