Answers for "::before content attr"

CSS
1

before content from attribute

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

/* css */
[data-foo]::before {
  content: attr(data-foo);
}
Posted by: Guest on June-18-2021

Browse Popular Code Answers by Language