color

« CSS « CSS Reference

Summary

The color CSS property sets the foreground color of an element's text content

Syntax

color: color       or        E.g. color : red;
color: inherit

Values

color
Is a <color> values for much details.

Examples

The following are all ways to make the element's text red:

element { color: red }
element { color: #f00 }
element { color: #ff0000 }
element { color: rgb(255,0,0) }
element { color: rgb(100%, 0%, 0%) }
element { color: hsl(0, 100%, 50%) }

/* 50% translucent */
element { color: rgba(255, 0, 0, 0.5) } 
element { color: hsla(0, 100%, 50%, 0.5) }

Specifications

Specification Status Comment
CSS Colors Level 3 Recommendation No direct change, though the <color> data type has been greatly extended.
CSS 2.1 Recommendation No  change.
CSS 1 Recommendation  

Browser compatibility

  • Desktop
  • Mobile

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 1.0 (1.7 or earlier) 3.0 3.5 1.0
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 1.0 1.0 (1) 6.0 6.0 1.0

See also

 

HTML5 Documentation
HTMLAudio/Video Canvas WebGL SVG MathML WebForms AppCache Microformats SemanticTags
JavascriptStorage IndexedDB WebSockets WebWorkers Events Drag/Drop ProtocolHandler Geolocation Focus
CSSNewSelectors Typography Visual Effects

"}" expected: /content/body/div[5]/pre, line 1, column 2 (click for details)

Tags (2)

Edit tags

Attachments (0)

 

Attach file