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

What is the influence between display/float/position attribute values in CSS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article is to share with you about the influence between display/float/position attribute values in CSS. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

There are three attributes related to layout and the creation of box: 'display',' position' and 'float', interact with each other as follows:

If the 'display' value is' none', then 'position' and' float' have no effect. In this case, no box is generated.

Otherwise, if the 'position' value is' absolute' or 'fixed', box is absolutely positioned, the calculated value of' float' is' none', and the value of 'display' is set according to the following table. The location of the box will be determined by the 'top',' right', 'bottom' and' left' attributes and their containment blocks.

Otherwise, if the value of 'float' is not' none', box is floating and the value of 'display' is set according to the following table.

Otherwise, if the element is the root element, the value of 'display' is set according to the following table (except for the value specified by list-item, the value is calculated as' block' or 'list-item', is not defined in CSS2.1. )

Otherwise, the value of the 'display' property is the value specified in the rest of the case.

Inline-flex and flex are the new attribute values introduced by the CSS3 elastic layout module.

In a nutshell, the display properties of content items in absolute positioning, flexible layout, and grid layout containers are blockified.

Thank you for reading! This is the end of this article on "what is the influence between display/float/position attribute values in CSS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

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