Home > Web Front-end > HTML Tutorial > CSS positioning: relative positioning, absolute positioning and fixed positioning (relative absolute fixed)

CSS positioning: relative positioning, absolute positioning and fixed positioning (relative absolute fixed)

WBOY
Release: 2016-08-18 08:57:58
Original
1476 people have browsed it

Relative positioning: position:relative;

 Does not break away from the document flow, refers to its own static position through top, bottom, left, right positioning, and can be hierarchically graded through z-index.

Absolute positioning: position:absolute;

  Break away from the document flow, position through top, bottom, left, right, and select its nearest parent element for positioning. When the position of the parent element is static, the absolute element will be positioned at the origin of the body coordinates, which can be positioned through the x-index level Grading.

Fixed positioning: position:fixed;

 The object he fixed here is the visual window instead of the body, or the parent element, which can be hierarchically graded through z-index.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template