<div class="container">
  <h1>Center in Window </h1>
</div>
// Styling
body {
  font-family: sans-serif;
  background: #252525;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.container {
  background: white;
  padding: 1rem;
  box-sizing: border-box;
  border-radius: 0.25rem;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.