.class { text-align: center; }
.centered { position: fixed; top: 50%; left: 50%; /* bring your own prefixes */ transform: translate(-50%, -50%); }
body { display:flex; flex-direction:column; justify-content:center; min-height:100vh; }
body { max-width: max-content; margin: auto; }
body { text-align: center; }
<style> .content { max-width: 500px; margin: auto; } </style> <body> <div class="content"> <!-- Page content --> </div> </body>