z-index > css background-img > absolute img > p tag

后端 未结 1 1471
北荒
北荒 2020-12-22 12:56

how to put my p tag above all?

here\'s my code

HTML
    
&l
1条回答
  •  时光说笑
    2020-12-22 13:14

    For z-index to work, the element need a position other than static

    .key-fundamentals p {
     position: relative;         /*  added property  */
     z-index: 2;
     color: red;
    }
    

    .key-fundamentals {
      z-index: -999;
      height: 535px;
      background-image: url('../images/bg-fundamentals.png');
      background-position: center;
      background-repeat: no-repeat;
    }
    
    .key-fundamentals .img-man-cbox {
      z-index: 1;
      position: absolute;
    }
    
    .key-fundamentals p {
      position: relative;
      z-index: 2;
      color: red;
    }

    Our key fundamentals

    0 讨论(0)
提交回复
热议问题