Gradients

One of CSS3's amazing color feature is gradients. They allow a smooth transition from one color to another.

They are declared using the background-image property as they have no special property.

Gradients allow us to create transparency by translating the color hex to rgba mode.

In spite of many enhancements, vendor prefixes are used to make the form browser compatible so the browser can interpret the styles.

Syntax

The syntax for gradients is as follows:

linear-gradient (<angle><to [left / right || top / bottom]><color [percentage/length]><color [percentage/length]>)

Values

The values of gradients include the following:

  • angle: This specifies the gradient's angle of direction
  • color: This specifies the color value with an optional option of stop ...

Get Mastering HTML5 Forms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.