当我删除div的相对位置时,为什么div的框阴影消失了?

时间:2019-04-09 19:46:47

标签: css

我有一个top_div,当设置为相对位置时,框阴影会保留。当我删除相对位置时,框阴影消失了。有人可以帮助我了解这一点或我要去哪里哪里。

下面是代码,

<div class="top_div">
    <div class="drawer">
        <div class="menu">
            <header>
                <Svg>
                <button></button>
            </header>
            <ul>
                <li></li>
            </ul></div></div></div>


.top_div {
    z-index: 1;
    display: flex;
    position: relative;
    width: 100%;
    height: 48px;
    padding: 0 12px 0 12px;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
    align-items: center;
 }
.drawer {
    display: flex;
    flex-direction: column;
    background-color: $white;
    position: absolute;
    width: 380px;
    top: 55px;
    right: 8px;
    min-height: 40%;
    max-height: 80%;

    header {
        height: 41px;
        border-bottom: 1px solid #CCCCCC;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-right: 0px;
        padding-top: 2px;

        svg {
            margin-left: 16px; 
        }
    }

    ul {
       overflow-x: hidden;
    }}} 

0 个答案:

没有答案