webkit-gradient-linear-1a.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <!--
  3. Any copyright is dedicated to the Public Domain.
  4. http://creativecommons.org/publicdomain/zero/1.0/
  5. -->
  6. <html>
  7. <head>
  8. <title>
  9. CSS Test: -webkit-gradient(linear, ...) expressions,
  10. from center of each side to center of opposite side.
  11. </title>
  12. <style>
  13. div {
  14. border: 1px solid black;
  15. width: 100px;
  16. height: 50px;
  17. margin: 1px;
  18. float: left;
  19. /* We include a fallback background, to easily distinguish failures at
  20. * parse time (which fall back to this value) vs. something later on. */
  21. background: red;
  22. }
  23. br { clear: both; }
  24. </style>
  25. </head>
  26. <body>
  27. <!-- Left to right gradients: -->
  28. <div style="background: -webkit-gradient(linear, left center, right center,
  29. from(blue), to(yellow))"></div>
  30. <div style="background: -webkit-gradient(linear, left center, right center,
  31. from(blue),
  32. color-stop(0.3, pink),
  33. to(yellow))"></div>
  34. <br>
  35. <!-- Right to left gradients: -->
  36. <div style="background: -webkit-gradient(linear, right center, left center,
  37. from(blue), to(yellow))"></div>
  38. <div style="background: -webkit-gradient(linear, right center, left center,
  39. from(blue),
  40. color-stop(0.3, pink),
  41. to(yellow))"></div>
  42. <br>
  43. <!-- Top to bottom gradients: -->
  44. <div style="background: -webkit-gradient(linear, center top, center bottom,
  45. from(blue), to(yellow))"></div>
  46. <div style="background: -webkit-gradient(linear, center top, center bottom,
  47. from(blue),
  48. color-stop(0.3, pink),
  49. to(yellow))"></div>
  50. <br>
  51. <!-- Bottom to top gradients: -->
  52. <div style="background: -webkit-gradient(linear, center bottom, center top,
  53. from(blue), to(yellow))"></div>
  54. <div style="background: -webkit-gradient(linear, center bottom, center top,
  55. from(blue),
  56. color-stop(0.3, pink),
  57. to(yellow))"></div>
  58. </body>
  59. </html>