How can I make my website's background transparent without making the content (images & text) transparent too?

前端 未结 8 1390
小鲜肉
小鲜肉 2020-12-15 04:25

I\'m doing a website for a school project, and I\'m currently having a small problem... I can\'t make the body\'s background transparent without it also affecting the conten

8条回答
  •  难免孤独
    2020-12-15 05:14

    I think what's happening, is that, since the wrapper id is relatively position, it just appears on the same position with the body tag, what you should do, is that you can add a Z-index to the wrapper id.

    #wrapper {
    margin: auto;
    text-align: left;
    width: 832px;
    position: relative;
    padding-top: 27px;
    z-index: 99; /* added this line */
     }
    

    This should make layers above the transparent body tag.

提交回复
热议问题