Home > Article > Web Front-end > What does height mean in css
In css, height means the height of the element and is an attribute in css; this attribute is used to define the height of the content area of the element, excluding padding, borders or margins. Inline non-replaced elements will Ignore this attribute. By default, the value of this attribute is "auto" and the syntax is "element {height: attribute value;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
The height attribute sets the height of the element.
Note: The height attribute does not include padding, borders, or margins!
This attribute defines the height of the element's content area. Padding, borders and margins can be added outside the content area.
Inline non-replaced elements will ignore this attribute.
The attribute values are as follows:
The example is as follows:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>123</title> <style> img.normal { height:auto; } img.big { height:120px; } p.ex { height:100px; width:100px; } </style> </head> <body> <img class="normal" src="logocss.gif" style="max-width:90%" style="max-width:90%" / alt="What does height mean in css" ><br> <img class="big" src="logocss.gif" style="max-width:90%" style="max-width:90%" / alt="What does height mean in css" > <p class="ex">这个段落的高和宽是 100px.</p> <p>这是段落中的一些文本。这是段落中的一些文本。 这是段落中的一些文本。这是段落中的一些文本。 这是段落中的一些文本。这是段落中的一些文本.</p> </body> </html>
Output result:
(Learning video sharing: css video tutorial, html video tutorial)
The above is the detailed content of What does height mean in css. For more information, please follow other related articles on the PHP Chinese website!