<div class="container" data-size="background-size: 100%">
  <div class="element"></div>
  <div class="element"></div>
</div>

<div class="container" data-size="background-size: 50%">
  <div class="element"></div>
  <div class="element"></div>
</div>

<div class="container" data-size="background-size: 150%">
  <div class="element"></div>
  <div class="element"></div>
</div>
@import url("https://fonts.googleapis.com/css?family=Gochi+Hand");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  background-color: #291642;
  font-family: "Gochi Hand", sans-serif;
  font-size: 100%;
  letter-spacing: 0.1rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  background-blend-mode: hue;
}

.container {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  margin: 5px;
}

.container::before {
  content: attr(data-size);
  position: absolute;
  top: calc(100% + 5px);
}

.element {
  width: 150px;
  height: 150px;
  box-shadow: 0 0 0 1px #f36;
  margin: 0 2px;
  background: url("//www.w3cplus.com/sites/default/files/blogs/2020/2008/css-percentage-unit-14.png")
    no-repeat;
}

.container:nth-child(1) .element:first-child {
  background-size: 100%;
}

.container:nth-child(1) .element:last-child {
  background-size: 150px 96.42857px;
}

.container:nth-child(2) .element:first-child {
  background-size: 50%;
}

.container:nth-child(2) .element:last-child {
  background-size: 75px 48.21429px;
}

.container:nth-child(3) .element:first-child {
  background-size: 150%;
}

.container:nth-child(3) .element:last-child {
  background-size: 225px 144.64286px;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.