Kevin Powell - CommunityKP-C
Kevin Powell - Community3y ago
25 replies
CDL

Typical starting template for creating a div container on an entire page?

Morning

I always mess this up somehow, my typical start is below:

<body>
  <div class="container">
    <other code here for the page>
  </div>
</body>

However I always mess up the CSS and end up with the div container taking up half the page, or only taking up a tiny portion of the page etc etc... Would be great if anyone had a standard "template" they used that they just copy pasted or whatever to get the initial code started on an app. So far the only initial code I have for my apps is below:

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

body {
    min-height: 100vh;
}
Was this page helpful?