HTML

by ammgena

HTML

<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/attr -->

<div class="background" data-background="grey">background expect to be red if your browser does not support adavanced usage of attr()</div>

CSS

.background {
  height: 100vh;
}.background {
  background-color: yellow;
}

.background {
  background-color: attr('background', 'green');
}