简体   繁体   English

如何将绝对定位的DIV放在SPAN或相对定位的DIV后面?

[英]How to put absolutely positioned DIV behind the SPAN or relatively positioned DIV?

Is it possible to put absolutely positioned DIV behind the SPAN or relatively positioned DIV? 是否可以将绝对定位的DIV放在SPAN或相对定位的DIV后面? It seems to me that z-index does not affect SPANs etc. 在我看来,z-index不会影响SPAN等。

Use span { display: block; } 使用span { display: block; } span { display: block; } . span { display: block; }

I think that will place the span above the absolutely positioned div. 我认为这会将span置于绝对定位的div上方。 And the z-index should also be defined. 并且还应该定义z-index Also, I usually don't use position: relative for a div that has to be placed below other div's . 另外,我通常不使用position: relative来将div放置在其他div's下面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM