A linear gradient with multiple color stops: - HTML CSS CSS

HTML CSS examples for CSS:Color

Description

A linear gradient with multiple color stops:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {<!--from   ww  w .  ja  v a  2  s .  co m-->
    height: 55px;
    background: -webkit-linear-gradient(left, red, orange, yellow, green, blue, yellow,blue,black,pink); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(left, red, orange, yellow, green, blue, yellow,blue,black,pink); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(left, red, orange, yellow, green, blue, yellow,blue,black,pink); /* For Fx 3.6 to 15 */
    background: linear-gradient(to right, red, orange, yellow, green, blue, yellow,blue,black,pink); /* Standard syntax (must be last) */
}
</style>
</head>
<body>

<div id="grad1" style="text-align:center;margin:auto;color:#888888;font-size:40px;font-weight:bold">
Gradient Background
</div>



</body>
</html>

Related Tutorials