"."/> ".">

Home  >  Article  >  Web Front-end  >  How to set the size of the button in html

How to set the size of the button in html

青灯夜游
青灯夜游Original
2021-05-19 16:28:2218844browse

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 "".

How to set the size of the button in html

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:

How to set the size of the button in html

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn