css-attr-typed.html 632 B

123456789101112131415161718192021222324252627
  1. <!doctype html>
  2. <link rel="match" href="reference/css-attr-typed-ref.html" />
  3. <style>
  4. div {
  5. width: 100px;
  6. height: 20px;
  7. border: 1px solid black;
  8. }
  9. .string::before {
  10. content: attr(foo string);
  11. }
  12. .length {
  13. width: attr(foo length);
  14. }
  15. .px {
  16. width: attr(foo px);
  17. }
  18. .color {
  19. background-color: attr(foo color);
  20. }
  21. </style>
  22. <div class="string" foo="WHF!"></div>
  23. <div class="string" foo=""></div>
  24. <div class="length" foo="200px"></div>
  25. <div class="px" foo="200"></div>
  26. <div class="color" foo="lime"></div>
  27. <div class="color" foo="#00ff00"></div>