SOURCE

console 命令行工具 X clear

                    
>
console
<div class="father1">
    <div class="son1">非绝对定位元素宽高百分比值基于父元素的content-box</div>
</div>

<div class="father2">
    <div class="son2">绝对定位元素宽高百分比值基于父元素的padding-box</div>
</div>
.father1, .father2{
    width: 100px;
    height: 100px;
    border: 1px solid red;
    padding: 10px;
    margin: 10px;
}

.son1{
    width: 100%;
    height: 100%;
    border: 1px solid green;
}

.father2{
    position: relative;
}
.son2{
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid green;
}