Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS background-color definition

Syntax

background-color: <color>

Description

The background-color property defines the background color of an element.

Values

Value Description

Transparent

Default value. Makes the background color transparent.

RGB color value

Example: rgb(0,255,0)

Hexadecimal color keyword

Example: #FF0000

CSS color keyword

Example: red

See Also

 background, background-attachment, background-image, background-position and background-repeat.

Example

[Try this example yourself]
<p style="background-color: yellow">Example text</p>

Output

Example text

  • Comments

No comments added.