为什么<div>标签不能正确计算

    <div class="page-wrapper">
        <div class="content-wrapper">
            <header class="main-head">
                <div class="main-title">
                    <img src="pictures/hyplogo-pics/hyp-logo.png" alt="Hyp" class="hypwiki-logo-hyp">
                    <img src="pictures/hyplogo-pics/white-wiki-logo.png" alt="Wiki" class="hypwiki-logo-wiki">
                    <h1 id="frontpg-title">
                        Hypwiki - The (Unofficial) Ultimate Hypixel Guide [v0.1]
                    </h1>
                </div>
                <nav class="nav-bar">
                    <div class="nav-options">
                        <form method="get" action="index.html">
                            <button class="btn home-btn" type="submit">HOME</button>
                        </form>

                        <form method="get" action="guide-pgs/guide-contents-pg.html">
                            <button class="btn guide-btn" type="submit">GUIDE</button>
                        </form>

                        <form method="get" action="">
                            <button class="btn help-btn" type="submit">HELP</button>
                        </form>

                        <form method="get" action="">
                            <button class="btn report-btn" type="submit">REPORT</button>
                        </form>

                        <form method="get" action="">
                            <button class="btn credits-btn" type="submit">CREDITS</button>
                        </form>

                        <form method="get" action="">
                            <button class="btn about-btn" type="submit">ABOUT</button>
                        </form>

                        <form method="get" action="">
                            <button class="btn extras-btn" type="submit">EXTRAS</button>
                        </form>
                    </div>
                </nav>
            </header>
            <main id="frontpg-main">
                <article>
                    <div id="frontpg-intro">
                        <p>
                            This is a personal project that I started to do an in depth guide on every aspect of
                            Hypixel,
                            and
                            covering all of Hypixel's current games, cosmetics, hidden easter eggs, tips and tricks,
                            techniques
                            and skills.
                        </p>
                        <p>
                            I myself is not that much of a veteran, and get most of my info through Hypixel.net threads
                            and
                            sources. If there are any incorrect/outdated information, or anything you think should be
                            added,
                            head over to the <a href="">report section</a> to tell me.
                        </p>
                    </div>
                </article>
            </main>
            <footer>
                <div>
                    <p class="help-req">
                        Looking for Hypixel veterans to help!
                        If you wish to help or support this project, start a converstion with me at <a
                            href="https://hypixel.net/members/yolo_beast.3290069/">[ https://hypixel.net/members/yolo_beast.3290069/
                            ]</a> or dm me on <a href="https://discord.com">Discord</a>, tag: [ Benzo©#8469 ] and I will
                        try to reply asap.
                    </p>
                </div>
            </footer>
        </div>
    </div>

这是我的代码的一部分。我遇到的问题是应该覆盖所有内容(标题,主要和页脚),但是当我运行它时,它仅覆盖最高位(下面的代码显示了浏览器如何处理代码):

    <div class="content-wrapper">
        <header class="main-head">
            <div class="main-title">
                <img src="pictures/hyplogo-pics/hyp-logo.png" alt="Hyp" class="hypwiki-logo-hyp">
                <img src="pictures/hyplogo-pics/white-wiki-logo.png" alt="Wiki" class="hypwiki-logo-wiki">
                <h1 id="frontpg-title">
                    Hypwiki - The (Unofficial) Ultimate Hypixel Guide [v0.1]
                </h1>
            </div>
            <nav class="nav-bar">
                <div class="nav-options">
                    <form method="get" action="index.html">
                        <button class="btn home-btn" type="submit">HOME</button>
                    </form>

                    <form method="get" action="guide-pgs/guide-contents-pg.html">
                        <button class="btn guide-btn" type="submit">GUIDE</button>
                    </form>

                    <form method="get" action="">
                        <button class="btn help-btn" type="submit">HELP</button>
                    </form>

                    <form method="get" action="">
                        <button class="btn report-btn" type="submit">REPORT</button>
                    </form>

                    <form method="get" action="">
                        <button class="btn credits-btn" type="submit">CREDITS</button>
                    </form>

                    <form method="get" action="">
                        <button class="btn about-btn" type="submit">ABOUT</button>
                    </form>

                    <form method="get" action="">
                        <button class="btn extras-btn" type="submit">EXTRAS</button>
                    </form>
                </div>
            </nav>
        </header>
    </div>  <!-- <------------------------- </div> here!? wtf??? -->
    <main id="frontpg-main">
        <article>
            <div id="frontpg-intro">
                <p>
                    This is a personal project that I started to do an in depth guide on every aspect of
                    Hypixel,
                    and
                    covering all of Hypixel's current games, cosmetics, hidden easter eggs, tips and tricks,
                    techniques
                    and skills.
                </p>
                <p>
                    I myself is not that much of a veteran, and get most of my info through Hypixel.net threads
                    and
                    sources. If there are any incorrect/outdated information, or anything you think should be
                    added,
                    head over to the <a href="">report section</a> to tell me.
                </p>
            </div>
        </article>
    </main>
    <footer>
        <div>
            <p class="help-req">
                Looking for Hypixel veterans to help!
                If you wish to help or support this project, start a converstion with me at <a
                    href="https://hypixel.net/members/yolo_beast.3290069/">[
                    https://hypixel.net/members/yolo_beast.3290069/
                    ]</a> or dm me on <a href="https://discord.com">Discord</a>, tag: [ Benzo©#8469 ] and I will
                try to reply asap.
            </p>
        </div>
    </footer>
</div>

Can someone tell me what i am doing wrong? i dont understand why the </div> moved from the end of the code to just before <main>.

谢谢。