<!doctype html><style>
    * {
        outline: 1px solid black;
    }
    body {
        display: grid;
        width: 500px;
    }
    div.a {
        padding-top: 25%;
        margin-top: 10%;
        background: pink;
    }
    div.b {
        padding-bottom: 35%;
        margin-bottom: 20%;
        background: orange;
    }
</style><body><div class="a"></div><div class="b"></div>
