Home HTML CSS JavaScript React Gamedatum.com
× Home HTML CSS JavaScript React Gamedatum.com

CSS Colors


The color property in CSS defines the color of the selected element.

The color can be specified either with names or HEX, RGB, RGBA, HSL, HSLA values.

For example:

Name: DodgerBlue

Hex: #1E90FF

RGB: 30, 144, 255

HSL: 0.58, 1.00, 0.56

Other color names are: Tomato, Orange, Violet, MediumSeaGreen, Gray, Slateblue and more

For example:

                 
                  
  <!DOCTYPE html>
  <html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>The Class selector</title>
    </head>
    <style>
      .color {color: DodgerBlue;}
    </style>
    <body>
      <p class="color">This a DodgerBlue color paragraph</p>
    </body>
  </html>
    
    

The result:

This a dodgerBlue color paragraph