Color, Gradient and Opacity

Color

All the colors in the CSS3 Color Specifications have 147 colors, represented by 17 basic colors, with 130 other shades. The names of these colors can be used instead of using color codes in various HTML tags and CSS. The list of basic color keywords is: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. The color names are case-insensitive.

  • Fuchsia has the same color code as Magenta
  • Aqua has the same color code as Cyan
  • Lightgrey is spelled with an ‘e’, all other grays are spelled with an ‘a’
  • Darkgray is actually lighter than Gray
  • Lightpink is actually darker than Pink

CSS3 Gradients

CSS3 gradients let you display smooth transitions between two or more specified colors.

Earlier, you had to use images for these effects. However, by using CSS3 gradients you can reduce download time and bandwidth usage. In addition, elements with gradients look better when zoomed, because the gradient is generated by the browser. CSS3 defines two types of gradients

  • Linear Gradients (goes down/up/left/right/diagonally) – To create a linear gradient you must define at least two color stops. Color stops are the colors you want to render smooth transitions among. You can also set a starting point and a direction (or an angle) along with the gradient effect. Top to Bottom is default. Syntax – background: linear-gradient(direction, color-stop1, color-stop2, …);
  • Radial Gradients (defined by their center) – A radial gradient is defined by its center. To create a radial gradient you must also define at least two color stops. By default, shape is ellipse, size is farthest-corner, and position is center. Syntax – background: radial-gradient(shape size at position, start-color, …, last-color);

Go To- Certified CSS3 Developer Tutorial

Text Effects and Typographic styles
Transition and Animation

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?