1

Instead of wrapping everything in a <div>, can I just the set the display of <body> to grid?

<style>
    .grid-container {
        display: grid;
        // Other grid stuff
    }
</style>
…
<body>
    <div class="grid-container">
        <div class="header"></div>
        <div class="other"></div>
    </div>
</body>

vs.

<style>
    body {
        display: grid;
        // Other grid stuff
    }
</style>
…
<body>
    <div class="header"></div>
    <div class="other"></div>
</body>
Eric Xu
  • 306
  • 3
  • 10
  • 1
    Have you tried it to see if it works? – TylerH Jan 30 '20 at 19:42
  • 1
    Yes, I've tried it and it works. I'm new to web design and was wondering if that would be proper. – Eric Xu Jan 30 '20 at 19:51
  • 1
    Yes, it's proper. If the spec doesn't give any cautionary statements or commentary about it not being used for something, then it's usually OK to assume it's fine. – TylerH Jan 30 '20 at 20:33

0 Answers0