html {
  --size: 8vmin;
  --width: calc(var(--size) * 4);
  --height: calc(var(--size) * 1);
  --font-size: calc(var(--size) * 0.25);
  --font-family: Arial, Verdana, sans-serif;
  --font-weight: bold;
}

html::before {
  content: "CSS Box Model";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(var(--size) * -4.5));
  font-size: calc(var(--font-size) * 3);
  font-family: var(--font-family);
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
}

body {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--width);
  height: var(--height);
  border: var(--size) solid #aaa;
  padding: var(--size);
  box-shadow: inset 0 0 0 var(--size) #cde, 0 0 0 var(--size) #fdd, inset 0 0 0 calc(var(--size) + 1px) rgba(0,0,0,0.25);
  font-size: var(--font-size);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: var(--font-weight);
  outline: 1px dashed rgba(0,0,0,0.25);
  outline-offset: var(--size)
}

body::before {
  content: 'margin \a border \a padding \a content';
  text-transform: uppercase;
  line-height: var(--size);
  text-align: center;
  white-space: pre;
}

body::after {
  content: 'margin edge \00a0\00a0\00a0\00a0\00a0 \a border edge \00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0 \a padding edge \00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0 \a content edge \00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0';
  text-transform: uppercase;
  line-height: var(--size);
  text-align: center;
  white-space: pre;
  position: absolute;
  display: block;
  left: 0;
  text-align: left;
  font-size: calc(var(--font-size) * 0.75);
  transform: translate(calc(var(--size) * -3.625), 0);
  font-weight: normal;
  text-decoration: underline;
}

@media (orientation: portrait) {
  body::after {
    content: 'margin edge \a \00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0 border edge \a \00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0 padding edge \a \00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0 content edge';
    text-decoration: none;
    transform: translate(calc(var(--size) * -2), calc(var(--size) * -0.61));
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.