A snippet to center content. This uses flexbox.
<html>
<body>
<div>Centered</div>
</body>
</html>
<style>
html { height: 100vh; }
body {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
</style>
I find that flexbox feels far more natural to use than anything else. I really need to use grid though because I think it may be more powerful. It does however feel much less simple.