The restriction of postion relative to absolute and fixed

If an element is positioned absolute, if its parent element is positioned relative then the positioning of the element will be restricted

absolute

1. Limit left, top, right, bottom, and position it in the parent element.

2. Limit the z-index level, the child element level is the same as the parent element level

3. It is limited to overflow. If there is no parent element positioning absolute, the child element overflow will have no effect, and the excess content will be exposed. If the parent element adds positioning relative, the overflow of the child element can be controlled

fixed restrictions

Only the z-index level of child elements can be restricted, the same as the parent element level. No other restrictions

https://www.imooc.com/video/10710

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324933885&siteId=291194637