reversing z-index based from page render order

前端 未结 4 1196
遇见更好的自我
遇见更好的自我 2020-12-29 06:41

Example Markup:

Trigger

This is some content
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 07:15

    So still no answer here, i just did something similar, even though my workaround is 100% hack, if anyone else comes to this page, it did work!

    #nav ul li:nth-child(1) {
            z-index:10; 
        }
        #nav ul li:nth-child(2) {   
            z-index:9;  
        }
        #nav ul li:nth-child(3) {
            z-index:8;  
        }
        #nav ul li:nth-child(4) {   
            z-index:7;  
        }
        #nav ul li:nth-child(5) {
            z-index:6;  
        }
        #nav ul li:nth-child(6) {   
            z-index:5;  
        }
    

    I just had that and as long as i didn't get over 10 elements it seems to work...

提交回复
热议问题