CSS I want a div to be on top of everything

前端 未结 6 1412
孤街浪徒
孤街浪徒 2020-12-04 16:21

How do I make an html div tag to be on top of everything?

6条回答
  •  时光取名叫无心
    2020-12-04 16:50

    I gonna assumed you making a popup with code from WW3 school, correct? check it css. the .modal one, there're already word z-index there. just change from 1 to 100.

    .modal {
        display: none; /* Hidden by default */
        position: fixed; /* Stay in place */
        z-index: 1; /* Sit on top */
        padding-top: 100px; /* Location of the box */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        background-color: rgb(0,0,0); /* Fallback color */
        background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }
    

提交回复
热议问题