Home>Article>Web Front-end> How to set button size and color in html
In HTML, you can use the width and height attributes to set the size of the button element, and use the background-color attribute to set the color of the button element. The specific syntax is "button{width: width value; height: height value ;background-color: color value;}".
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
HTML
Inside the
htmlSet button size and color
Rendering:
css width and height Properties
width property sets the width of the element.
The height attribute sets the height of the element.
Value | Description |
---|---|
auto | Default value. The browser can calculate the actual width or height. |
length | Define width or height using units such as px, cm, etc. |
% | # Defines a percentage width or height based on the width of the containing block (parent element). |
CSS background-color property
The background-color property sets the background color of an element.
Value | Description |
---|---|
##color | Specifies the background color.|
Specifies that the background color should be transparent. This is the default |
CSS video tutorial]
The above is the detailed content of How to set button size and color in html. For more information, please follow other related articles on the PHP Chinese website!