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 use Css to locate position

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

Share

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

The purpose of this article is to share with you how to use Css to locate position. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

CSS has three basic positioning mechanisms: normal stream, floating and absolute positioning.

There are N positioning methods in CSS, among which static and relative,absolute are the three most basic and commonly used positioning methods. Value of position:

Static default location method

Relative relative positioning. Relative to the original position, but the original position is still retained. Understood as the arrangement of pieces on a chessboard:

The pieces are arranged from left to right and move to the next row when they reach the edge. The arrangement of the pieces is determined by display. Elements with a value of block for the style attribute display are automatically placed on the next line (the default), while elements for inline are automatically placed on the same line, after the previous element. Objects cannot be stacked, and their positions are offset in the normal document stream according to attributes such as left,right,top,bottom.

Absolute absolute positioning. Relative to the recent non-standard flow positioning, the original position disappears and is replaced by the position of the subsequent element.

This attribute is relative to the reference and specifies the location of the rectangular locality of the element relative to the area of the parent element.

Drag the object given this positioning method from the document flow, and use left,right,top, bottom and other properties to position absolutely relative to the nearest parent object with positioning settings. If the parent of the object does not set positioning properties, that is, it still follows the HTML positioning rules, it is positioned according to the upper-left corner of the body object as a reference. Absolute positioning objects can be cascaded, the cascading order can be controlled by the z-index property, the z-index value is a unitless integer, the large one is at the top, and can have negative values.

Offset attribute value:

Left: left position offset

Right: position offset on the right

Top: position offset of top

Bottom: position offset of bottom

Relative relative positioning

Absolute absolute positioning

Thank you for reading! This is the end of the article on "how to use Css positioning position". 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 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