css use value of attribute

34

/* html */
<p data-foo="Lorem Ipsum"></p>

/* css */
[data-foo]::before {
  content: attr(data-foo);
}

Comments

Submit
0 Comments