Text Above Image CSS Z-Index Not Working

前端 未结 2 886
被撕碎了的回忆
被撕碎了的回忆 2021-01-26 16:35

I am trying to force the text above the image, however, It doesn\'t want to work, I have tried z-index 100 on the text and -100 on the image, but It still doesn\'t work...

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-26 17:14

    probably using position and z-index will help check this snippet

    .menu-gallery-options-title{
      position:relative;
        width: 100%;
        height: auto;
        text-align: center;
      z-index:999;
    }
    

        .menu-defaults{
        width: 100%;
        height: 100%;
    }
    .menu-container{
        width: 90%;
        height: 100%;
        margin: 0 auto;
    }
    .menu-gallery{
        margin-top: 160px;
    }
    .menu-gallery-options{
        width: 460px;
        height: 259;
        box-shadow: 0px 0px 20px #000;
        margin: 20px 20px 20px 20px;
    }
    .menu-gallery-options-title{
      position:relative;
        width: 100%;
        height: auto;
        text-align: center;
      z-index:999;
    }
    .gallery-options-title-style{
        font-size:32px;
        font-weight: 900;
        color: white;
        font-family: arial;
        text-decoration: none;
    }
    .menu-gallery-options-img{
        margin: -45px 0;
        padding: 0;
    }
    .gallery-options-img-style{
        width: 100%;
        height: auto;
    }

提交回复
热议问题