<body>
    <div id="container" style="width: 400px; display: none;">
        <span style="position: relative">
            <br>
            <div style="z-index: -1; position: absolute; width: 100px; height: 100px; background-color: green;"></div>
            <div id="target" style="display: inline-block; width: 100px; height: 100px; background-color: red;"></div>
        </span>
    </div>
    <script>
            document.body.offsetTop;
            document.getElementById("container").style.removeProperty("display");
            document.body.offsetTop;
            document.getElementById("target").style.height = "0";
    </script>
</body>
