Home  >  Article  >  Web Front-end  >  What does height mean in css

What does height mean in css

WBOY
WBOYOriginal
2022-06-30 11:06:135031browse

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

What does height mean in css

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

What does height mean in css

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:

What does height mean in css

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:

What does height mean in css

(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!

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