<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="main.css" />
    <title>Object 1</title>
  </head>
  <body>
    <div class="diamond">
      <span class="child"></span>
      <span class="child"></span>
      <span class="child"></span>
      <span class="child"></span>
    </div>
  </body>
</html>
* {
  box-sizing: border-box;
}

html {
  font-size: 50%;
  min-width: 200px;
  min-height: 300px;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diamond {
  position: relative;
  width: 20rem;
  height: 20rem;
}

.child {
  position: absolute;
  z-index: 1;
  width: 50%;
  height: 50%;
  margin: 5px -5px;
}

.child:nth-child(1) {
  position: absolute;

  background-color: rgb(226, 55, 43);
  bottom: 50%;
  left: 0;
}

.child:nth-child(2) {
  position: absolute;
  bottom: 50%;
  right: 0;
  background-color: rgb(43, 226, 98);
}

.child:nth-child(3) {
  position: absolute;
  top: 50%;
  right: 0;
  background-color: rgb(230, 179, 70);
}

.child:nth-child(4) {
  position: absolute;
  left: 0;
  top: 50%;
  background-color: rgb(43, 137, 226);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.