Relative positioning includes classification according to positioning method, classification according to positioning direction, classification according to positioning distance and classification according to positioning reference object. Detailed introduction: 1. Classification according to positioning method includes static positioning, relative positioning, absolute positioning and fixed positioning; 2. Classification according to positioning direction includes horizontal positioning and vertical positioning; 3. Classification according to positioning distance includes static positioning, relative positioning, Absolute positioning and fixed positioning; 4. Classification according to positioning reference objects includes static positioning, relative positioning, absolute positioning and fixed positioning.
The operating system for this tutorial: Windows 10 system, DELL G3 computer.
Relative positioning is a commonly used method in image layout, which can be classified according to different needs and scenarios. The following are some common relative positioning classification methods:
1. Classification based on positioning methods
Static positioning (static): Static positioning is the default positioning method of elements. Arrange according to normal document flow. In this positioning method, the element will not be affected by top, right, bottom and The influence of attributes such as left.
Relative positioning (relative): Relatively positioned elements are adjusted according to their position in the normal document flow. You can set top, right, bottom and left and other attributes to change the position of the element. Relatively positioned elements remain in the document flow and have no impact on other elements.
Absolute positioning (absolute): Absolutely positioned elements will break away from the document flow, relative to their nearest non-static The positioned ancestor element is positioned. If there are no ancestor elements, positioning is relative to the original containing block of the document. You can set top, right, bottom and left and other attributes to change the position of the element. Absolutely positioned elements have an impact on other elements.
Fixed positioning (fixed): Fixed-positioned elements will break away from the document flow and be positioned relative to the browser window. You can set top, right, bottom and left and other attributes to change the position of the element. Fixed positioned elements have an impact on other elements.
2. Classification based on positioning direction
Horizontal positioning: Horizontal positioning means that an element is positioned in the horizontal direction relative to its ancestor elements. This can be achieved by setting the left and right properties.
Vertical positioning: Vertical positioning means that an element is positioned vertically relative to its ancestor elements. This can be achieved by setting the top and bottom properties.
3. Classification based on positioning distance
Static positioning: statically positioned elements will be adjusted according to their position in the normal document flow, but will not change the relationship between elements relative distance.
Relative positioning: Relatively positioned elements will be adjusted according to their position in the normal document flow. You can set top, right, bottom and left and other properties to change the relative distance between elements.
Absolute positioning: An absolutely positioned element will leave the document flow and be positioned relative to its nearest non-statically positioned ancestor element. The relative distance between elements is determined by top, right, bottom and Determined by properties such as left.
Fixed positioning: Fixed-positioned elements will break away from the document flow and be positioned relative to the browser window. The relative distance between elements is determined by properties such as top, right, bottom, and left.
4. Classification based on positioning reference objects
Static positioning: statically positioned elements will be adjusted according to their position in the normal document flow. The reference object is the element in the normal document flow. The position in the document flow.
Relative positioning: Relatively positioned elements will be adjusted according to their position in the normal document flow. The reference is the position of the element in the normal document flow.
Absolute positioning: Absolutely positioned elements will break away from the document flow, relative to their nearest non-static The positioned ancestor element is positioned. The reference is the position of the ancestor element. If there are no ancestor elements, positioning is relative to the original containing block of the document.
Fixed positioning: Fixed-positioned elements will break away from the document flow and be positioned relative to the browser window. The reference object is the position of the browser window.
In short, relative positioning can be classified according to different needs and scenarios. Understanding these classification methods will help you better master the use of relative positioning and achieve more flexible image layout.
The above is the detailed content of What are the categories of relative positioning?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.