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 are the uses of DIV layout properties

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

Share

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

This article will explain in detail what the DIV layout attributes are used, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

DIV layout properties:

In the previous HTML, the position of elements can only be felt by the arrangement of elements in turn, but in CSS you can locate elements more accurately. Netscape has proposed Layer markup, which is good for precise layout, but it has not been recognized by the W3C, which has proposed a function similar to Layer tagging in CSS.

The position property of the ◆ DIV layout property:

The position attribute is used to determine the location type of the element, as detailed in the attribute:

Attribute name: 'position'

Attribute value: absolute | relative | static

Initial value: static

Fit objects: all elements

Whether to inherit: no

Percentage remarks: prohibited

The attribute values represent:

Absolute: the absolute position on the screen.

Relative: the relative position on the screen.

Static: inherent position.

The direction property of the ◆ DIV layout property:

The direction attribute determines the orientation of the BOX. For more information, please see the attribute:

Attribute name: 'direction'

Attribute value: ltr | rtl

Initial value: ltr

Fit objects: all elements

Whether to inherit: yes

Percentage remarks: prohibited

The float and clear properties of the ◆ DIV layout properties:

In HTML, the picture can choose the floating position, and now the BOX object can also choose the floating position through CSS. Change the float attribute of BOX, and BOX will float to the left or right of other elements: attribute name: 'float'

Attribute value: left | right | none

Initial value: none

Fit objects: all elements

Whether to inherit: no

Percentage remarks: prohibited

For example:

IMG {float:left} BODY,P,IMG {margin:2em}

Somesampletextthathasnoother...

◆ conversely, using the clear attribute prevents the element from floating to the left or right of the BOX:

Attribute name: 'clear'

Attribute value: left | right | both | none

Initial value: none

Fit objects: all elements

Whether to inherit: no

Percentage remarks: prohibited

About the DIV layout attribute usage has shared here, hoped that the above content can have the certain help to everybody, can learn more knowledge. If you think the article is good, you can share it 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