<div class="container">
  <div class="container-content">
    <h2>Make me the centre of attention!</h2>
    <h4>Sub-heading wants some attention too.</h4>
  </div>
</div>
* {
  box-sizing: border-box;
}

:root {
  --minHeight: 100svh;
}

html, body {
  font-family: 'system-ui';
  min-height: var(--minHeight);
  border: 0.15rem orange solid;
  padding: 0;
  margin: 0;
}

.container {
  border: 0.25rem solid blue;
  min-height: var(--minHeight);
  padding: 1rem;
}

.container-content {
  position: absolute;
  width: 85%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  
}
h2 {
  border: 1px pink dashed;
  text-align: center;
  padding: 0.25rem;
  margin: 0;
}

h4 {
  border: 1px green dashed;
  text-align: center;
  padding: 0.125rem;
  margin: 0.25rem 0 0;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.