Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of height attribute in Css Technology

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report