html center body
snippet in html

center text in css

user4946

.class {
	text-align: center;
}

align in the middle of page html

user9577

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  /* bring your own prefixes */
  transform: translate(-50%, -50%);
}

html center body

user3233

body {
  display:flex; flex-direction:column; justify-content:center;
  min-height:100vh;
}

html center body

user7862

body {
max-width: max-content;
margin: auto;
}

css text align center

user580

body {
  text-align: center;
}

center page css

user7336


  <style>
.content {
  max-width: 500px;
  
  margin: auto;
}
</style>

  <body>

<div class="content">
  <!-- Page content -->
</div>

</body>