HTML boilerplate
This is my 'from scratch' HTML boilerplate. From time to time, I want to
generate basic HTML, with no fancy Javascript or CSS frameworks. But I don't
want it to look like we're back in the 1990s with no stylesheets at all. So
this is a minimal starting point. I'm releasing it under CC0, which means
you can use it and modify however you want, with no need to include a
copyright notice.
So what does it give you?
- Content limited to 1000 pixels wide. Text across the full width of the
screen becomes hard to read.
- Slightly increased line height (1.5x), making text less dense.
- Sans-serif font by default. I think this looks more modern than the
serif fonts browsers use if you don't specify a font.
- A hint for mobile browsers (meta
viewport), so that they will render the page to fit the screen,
rather than rendering it at desktop size and zooming out. This also helps
Google consider a page mobile friendly.
It doesn't magically make everything perfect on mobile, though, so you
should still test!
- Code to tell browsers that this is HTML 5 and UTF-8 encoded. The technical
norms for a modern website.
If there's anything you don't like about this, feel free to change it.
Contributing
Think I've missed something? Open an issue or a PR on
the GitHub repository. The aim is to keep this minimal, though. If you
want something bigger that looks nicer, look at
Bootstrap, or many other website frameworks out there.