Analysis of the reasons why z-index does not work

There are three kinds:

1. The parent tag's position attribute is relative;

2. The question tag has no position attribute (excluding static);

3. The question tag has a float attribute.

It is also easy to understand why the z-index of the insert will fail after the parent sets the position and z-index. There are three solutions:


1. Change position:relative to position:absolute;

2. Add position attribute to floating elements (such as relative, absolute, etc.);

3. Remove floating.

Guess you like

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