Color Values - HTML CSS CSS

HTML CSS examples for CSS:Color

Introduction

There are several ways to define a color values in CSS.

Color keywords

Color keywords are case-insensitive name for a specific color, for example, red, green, blue, yellow, black, etc.

Example

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
 <head>
  <title>CSS Color Keywords</title>
  <style type="text/css">
    h1 {<!--from ww  w  . j a v  a 2 s .  c  om-->
        color: red;
    }
    p {
        background-color: yellow;
    }
</style>
 </head>
 <body>
  <h1>This is a heading</h1>
  <p>This is a paragraph.</p>
 </body>
</html>

Related Tutorials