In HTML, you can set the width of the button through the width attribute. The function of this element is to set the width of the element. You only need to add the "width: width value length unit;" style to the button element button or input. Can.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
We have the following two buttons:
<button type="button">按钮一</button><br><br> <input type="button" value="按钮二" />
How to set the width of the button? Let’s introduce it below.
Method: Use the width attribute
width attribute to set the width of the element.
<button type="button">按钮一</button><br><br> <input type="button" value="按钮二" />
Recommended tutorial: "html video tutorial"
The above is the detailed content of How to set button width in html. For more information, please follow other related articles on the PHP Chinese website!