Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of height attribute in Css Technology

Shulou Source: shulou.com Published: 2022-06-01 10:48:36 10月16日 Update

This article mainly introduces the Css technology in the height attribute example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.

1. Height

1. Height:100px;-- sets a fixed height

General settings use a fixed height, many times will set a fixed height of the object box, so that the layout is neat, so that the object does not exceed the height of access, and so on. More various object setting height and highly flexible applications can be found on thinkcss to search and view picture and text case tutorials.

2. Height:60%-- sets the percentage height

The percentage height usage is less than the fixed height, while the object sets the percentage height, which is calculated based on the height of the object box parent (parent) object.

3. Do not set the height attribute

As long as the content is not fixed, and the height of the object box increases as the content increases, and the construction decreases, in this case, there is no need to set height for this object box.

More flexible various CSS problems can be found in thinkcss search to solve problems encountered in css layout.

After learning more basics of CSS, you can use it flexibly and use it as an example.

2. Simple application of height

1. Instance code

Height instance

.thinkcss {height:100px;width:200px; border:2px solid # F00}

In order to see the height of this object, set its border and width

The height of the first div in body is 100%.

To set 100% for the first div height within the body tag, you need to set the 100% height for the body. Setting 100% directly for the first DIV box object in the body cannot take effect.

Thank you for reading this article carefully. I hope the article "sample Analysis of height attributes in Css Technology" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Height object box more percentage article attribute technology example analysis content instance layout problem learning application search example superior Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Tech Info Linux MariaDB Huawei