<div class="uno">20%</div>
<div class="dos">50%</div>
div {
  margin: 1rem;
  padding: 1rem;
}
.uno{
  width: percentage(0.2);
  background-color: aqua;
}

.dos{
  width: percentage(2px / 4px);
  background-color: orange;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.