| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style> |
| .box { |
| display: inline-block; |
| height: 120px; |
| width: 200px; |
| margin: 10px; |
| border: 1px solid black; |
| background-repeat: no-repeat; |
| } |
| |
| .linear1 { |
| background-image: linear-gradient(to right, black); |
| } |
| |
| .linear2 { |
| background-image: linear-gradient(to right, white, black); |
| } |
| |
| .linear3 { |
| background-image: linear-gradient(to right, red, green, blue); |
| } |
| |
| .linear4 { |
| background-image: linear-gradient(to right, red 25%, green 50%, blue 75%); |
| } |
| |
| .linear5 { |
| /* Green should get shifted to 50% */ |
| background-image: linear-gradient(to right, red 50%, green 30%, blue 90%); |
| } |
| |
| .linear6 { |
| /* Green and yellow should be evenly spaced */ |
| background-image: linear-gradient(to right, red, yellow, green, blue); |
| } |
| |
| .linear7 { |
| background-image: linear-gradient(to right, red -50%, green, blue, green, blue 150%); |
| } |
| |
| .linear8 { |
| background-image: linear-gradient(to right, red, green 100px, blue); |
| } |
| |
| .linear9 { |
| background-image: linear-gradient(to right, red, green 120%, blue); |
| } |
| </style> |
| <script type="text/javascript" charset="utf-8"> |
| if (window.testRunner) { |
| var dumpPixels = true; |
| testRunner.dumpAsText(dumpPixels); |
| } |
| </script> |
| </head> |
| <body> |
| |
| <div class="linear1 box"></div> |
| <div class="linear2 box"></div> |
| <div class="linear3 box"></div> |
| <br> |
| <div class="linear4 box"></div> |
| <div class="linear5 box"></div> |
| <div class="linear6 box"></div> |
| <br> |
| <div class="linear7 box"></div> |
| <div class="linear8 box"></div> |
| <div class="linear9 box"></div> |
| |
| </body> |
| </html> |