Chapter 12: Colors and Backgrounds


TOP

Types of Color Values

Color values can be defined in these forms:

Color Name

Hexadecimal

RGB and RGBa

HSL and HSLa

color

This is also known as the 'foreground color'. This value can effect text and borders.

Example:

This is a test. This is also known as the 'foreground color'. This value can effect text and borders. Note that this blockquote was styled with the 'color' property to be green and this has made both the text and the border green.

Gradients

linear-gradient(ndeg, color, color)

radial-gradient()

You can specify shape, size, and center position of a radial gradient. Shape: circle, ellipse. Size: length units or percentage (width height). Position: center center by default. Keywords: closest-side, closest-corner, farthest-side, farthest-corner.

Repeating Gradients