O'Reilly logo

HTML5: Your visual blueprint™ for designing rich web pages and applications by Adam McDaniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPLY A COLOR GRADIENT

You can assign a linear color gradient in CSS3 that renders one side of an object in one color, shifting across the color spectrum to the other side of the object and the second color. linear-gradient is applied to the background-image property:

background-image: linear-gradient
(start, color1 percent, color2 percent, ... );

start defines a pair of coordinate numbers, or simple words, that specify where the color gradient will begin. Words such as top left, top, top right, left, right, bottom left, bottom, and right indicate that the gradient progresses from the specified location to the opposite side or corner. You can even specify degrees; for example, −90deg is equivalent to top. Specify one or more color percent

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required