CSS Boilerplate
Last modified: 12 February 2025Standard Boilerplate
The following is starting styles suitable for when you want a basic webpage:
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Roboto:wght@400;700&display=swap');
:root {
--ff-primary: 'Roboto', sans-serif;
}
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--ff-primary);
}
SPA Boilerplate
The following is starting styles suitable for when you want content centered, for example, when creating a single page application:
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Roboto:wght@400;700&display=swap');
:root {
--ff-primary: 'Roboto', sans-serif;
}
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
align-items: center;
display: flex;
font-family: var(--ff-primary);
flex-direction: column;
height: 100vh;
justify-content: center;
}
This code centers content on the page and sets it to be in a column format.
The Roboto font is imported (a very popular font for websites)