Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the uses of DIV layout properties

Shulou Source: shulou.com Published: 2022-06-02 13:54:06 10月04日 Update

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.

Tags: Attributes elements layout location object name remarks percent percentage accuracy content screen article more tags knowledge article selection good representative Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia Xiaomi MySQL MariaDB