在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML5  HTML/ after before 設(shè)置遮罩效果 時(shí) 遮罩總是擋住了對(duì)應(yīng)的元素?

after before 設(shè)置遮罩效果 時(shí) 遮罩總是擋住了對(duì)應(yīng)的元素?

@import "../../vari";

.up-mask {
  z-index: 100; //less then ui:z-index:1104
  &:after {
    content: '';
    position: fixed;
    z-index: 99;
    background-color: @default-mask-color;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}

目前的解決:增加一個(gè) 相鄰 dom

@import "../../vari";

.up-mask {
  z-index: 100; //less then ui:z-index:1104
  //&:after {
  //  content: '';
  //  position: fixed;
  //  z-index: 99;
  //  background-color: @default-mask-color;
  //  top: 0;
  //  right: 0;
  //  bottom: 0;
  //  left: 0;
  //}
  // after & before 會(huì)遮擋元素本身
  & + .mask {
    content: '';
    position: fixed;
    z-index: 99;
    background-color: @default-mask-color;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}

after & before 感覺(jué)還是對(duì)應(yīng)dom的內(nèi)嵌子dom;導(dǎo)致沒(méi)法設(shè)置低于自身的z-index。也許是我的寫(xiě)法不對(duì)?

回答
編輯回答
抱緊我

z-index 僅能在定位元素上奏效(例如 position:relative/absolute;)!

2017年2月13日 09:23
編輯回答
法克魷

z-index:-1試下

2018年6月11日 12:40