Kevin Powell - CommunityKP-C
Kevin Powell - Community3y ago
27 replies
Tim

Make div "behave" like body element

Considering this simple HTML:

<html>
    <head>
        <title>My website</title>
    </head>
    <body>
        <div id="app-root"></div>
    </body>
</html>


What is the best way to make the #app-root div "behave" like the <body> element?

For example, if I set background-color: red; on the <body> element, the page obviously becomes red. But if I do the same to #app-root nothing happens (obviously) because there's no content inside of it. But I want #app-root to behave like the <body> element.
Was this page helpful?