Home>Article>Web Front-end> How to set css input size

How to set css input size

青灯夜游
青灯夜游 Original
2021-04-27 18:41:57 14745browse

In CSS, you can use the width and height attributes to set the size of the input element. You only need to add the "width: width value; height: height value;" style to the input element. Input is an inline replacement element, and its effect is equal to that of a block element, so the width and height values can be set.

How to set css input size

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

In CSS, you can use the width and height attributes to set the size of the input element.

Code example:

用户名:

密码:

Rendering:

How to set css input size

##Description:

  • tag is used to collect user information. It is an inline replacement element. height/width/padding/margin are all available. The effect is equal to the block element.

    However, for inline non-replacement elements, height/width/padding top, bottom/margin top, and bottom have no effect. You can only use padding left, right and margin left, right to change the width.

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

(Learning video sharing:

css video tutorial)

The above is the detailed content of How to set css input size. 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