Home >Web Front-end >HTML Tutorial >Summary of div CSS absolute positioning (absolute) and relative positioning (relative)_html/css_WEB-ITnose

Summary of div CSS absolute positioning (absolute) and relative positioning (relative)_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:27:081185browse

1. When there is no external Div, there is no difference between setting absolute positioning (absolute) and relative positioning (relative)

2. Relative positioning occupies the position while absolute Positioning does not take up position and will float on top of other Divs

3. If the parent Div does not set positioning and the child Div needs to set the position, it does not matter whether the child Div sets absolute or relative positioning

4 If the parent Div is set to positioning, the child Div is set to absolute positioning relative to the browser. If the child Div is set to relative positioning, the position is relative to the parent Div.

5 If the statistical elements are all relative, then when setting the css (left) of the second div, it is relative to the distance from the first

Statement:
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