Absolute
, CSS
Statement: Position: absolute;
Top, right, bottom, left (hereinafter referred to as trbl) are located. If no trbl is set, the original vertices of the parent level are marked as the original vertices by default. If you set trbl and
If the position attribute is not set for the parent level, the current absolute locates the position based on the original vertex in the upper left corner of the browser. The position is determined by trbl.
In general, when the webpage is centered, absolute is prone to errors, because the webpage is always automatically adapted with the resolution, while absolute uses the browser's upper left corner as the original
Point, the location is not changed due to resolution changes. Many people make mistakes in this case. The characteristics of a webpage are similar to those of relative, but there are some essential differences.
Relative
In css: Position: relative;
He means absolute relative positioning. He refers to the original vertices of the parent level as the original vertices, and the original vertices of the body as the original vertices without a parent level for positioning with trbl, when the parent class has CSS such as padding
Attribute, the original vertex of the current level is located according to the original vertex of the parent level content area.
Sometimes we also need to rely on Z-index to set the upper and lower relations of the container. The larger the value, the higher the upper the corner. The value range is a natural number. Of course, it should be noted that the parent-child relationship cannot be set with Z-index. The parent-child relationship must be set at the parent level.