padding百分百值是相对谁的百分比

先看代码

    <style>
        .b619 {
            width: 100%;
            height: 0;
            padding-bottom: 56.2%;
            position: relative;
        }
        .b619 > .innerb169 {
            width: 100%;
            height: 100%;
            background-color: gainsboro;
            position: absolute;
        }
    </style>

    <div class="b169">
        <div class="innerb169">hello</div>
    </div>

要查一下资料了。规定基于父元素的宽度的百分比的内边距。

猜你喜欢

转载自www.cnblogs.com/zhansu/p/10314388.html