"."/> ".">
Home > Article > Web Front-end > How to set the size of the button in html
In html, you can use the style attribute of the button tag to add the "height: height value; width: width value;" style to the button element to set the size of the button. The syntax is "".
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
htmlSet the size of the button
<button>Click Me!</button><br /><br /> <button style="height:100px;width:100px;">Click Me!</button>
Rendering:
Description:
The width attribute sets the width of the element, and the height attribute sets the height of the element.
The width and height attributes define the width and height of the element's content area, excluding padding, borders, or margins; padding, borders, and margins can be added outside the content area.
Attribute value:
Value | Description |
---|---|
auto | default. The browser will calculate the actual height. |
length | Use px, cm and other units to define the height. |
% | Based on the percentage height of the block-level object that contains it. |
inherit | Specifies that the value of the height attribute should be inherited from the parent element. |
Recommended tutorials: html video tutorial, css video tutorial
The above is the detailed content of How to set the size of the button in html. For more information, please follow other related articles on the PHP Chinese website!