css-attr-typed-fallback.html 744 B

123456789101112131415161718192021222324252627282930
  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, "WHF!");
  11. }
  12. .string-no-fallback::before {
  13. content: attr(foo string);
  14. }
  15. .length {
  16. width: attr(foo length, 200px);
  17. }
  18. .px {
  19. width: attr(foo px, 200px);
  20. }
  21. .color {
  22. background-color: attr(foo color, lime);
  23. }
  24. </style>
  25. <div class="string"></div>
  26. <div class="string-no-fallback"></div>
  27. <div class="length" foo="90pizzas"></div>
  28. <div class="px" foo="twohundred"></div>
  29. <div class="color" foo="grunge"></div>
  30. <div class="color" foo="rgb(0,0,0)"></div>