Get the App
SLTechnology News&Howtos  ›  Development  › 

What's the difference between relative and absolute?

Shulou Source: shulou.com Published: 2022-06-01 05:22:48 09月25日 Update

In this article, the editor introduces in detail "what's the difference between relative and absolute", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "what's the difference between relative and absolute" can help you solve your doubts.

Position:absolute

Absolute positioning, it is with reference to the upper-left corner of the browser, with TOP, RIGHT, BOTTOM, LEFT (hereinafter referred to as TRBL) for positioning, when TRBL is not set, the original point is the original point by default according to the parent's marking point. If TRBL is set and the parent does not set the position attribute, then the current absolute is positioned with the upper left corner of the browser as the original point, and the location will be determined by the TRBL.

Position:relative

Absolute relative positioning, it refers to the original point of the parent as the original point, and if there is no parent, it takes the original point of BODY as the original point, with TRBL for positioning. When there are CSS attributes such as padding in the parent, the original point of the current level is located with reference to the original point of the parent content area.

After reading this, the article "what's the difference between relative and absolute" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Original positioning different content articles attributes upper left corner browser browsing proper location front ideas new knowledge more steps knowledge knowledge points articles details Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MariaDB NVidia Apple Redmi