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

How to parse the usage of four attributes in DIV layout

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces how to analyze the usage of the four attributes in the DIV layout, the content is very detailed, interested friends can refer to it, I hope it can be helpful to you.

In the process of learning page layout, whether you understand the attributes of DIV layout, in the previous HTML, the location of elements can only be felt by the arrangement of elements in turn, while in CSS you can locate elements more accurately.

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.

Position property of ◆ DIV layout:

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

Attribute name: 'position'

Attribute value: absoluterelativestatic

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.

Direction property of ◆ DIV layout:

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

Attribute name: 'direction'

Attribute value: ltrrtl

Initial value: ltr

Fit objects: all elements

Whether to inherit: yes

Percentage remarks: prohibited

The float and clear properties of the ◆ DIV layout:

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 floats to the left or right of other elements:

Attribute name: 'float'

Attribute value: leftrightnone

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: leftrightbothnone

Initial value: none

Fit objects: all elements

Whether to inherit: no

Percentage remarks: prohibited

On how to analyze the use of the four attributes in the DIV layout to share here, I hope that the above content can be of some help to you, 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