You are here: Reference > CSS > properties > color

color property

Browser support:
Specifies the color of the element's text content.
JavaScript page for this property: color. You can find other example(s) there.

Possible values:

 One of the following values: 
color
Color of the text content. For the supported color values, see the colors page.
inherit
Takes the value of this property from the computed style of the parent element.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the color property:
<head>
    <style>
        .example1 {
            color: #9AEECC;
        }
        .example2 {
            color: #CCEE55;
        }
    </style>
</head>
<body>
    <h1 class="example1">text with color #9AEECC</h1>
    <h2 class="example2">text with color #CCEE55</h2>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content