Browser Compatibility

  • Chrome 122
  • Edge 119
  • Firefox 123
  • Opera 104


HTML Background Color

HTML Background Color enables the inclusion of the background color on the web page, which can be accomplished with the help of the background-color property using with HTML element. It applies to the total size of the element specified but the margin is not included. The property has the default value transparent. The value of the background color property can be as named value specified in HTML, the HEX color values, RGB color values, and HSL values.

Table of Content

  • Syntax
  • Understanding the background-color
  • Usage of HTML Background Color
  • Changing the Background Color
  • Browser Compatibility

Similar Reads

Syntax

// For Internal & External Styling background-color: red; // Inline styling

Content...
...

Understanding the background-color

The background-color property defines the background color applied to the HTML element. The background-color property is quite often used for specifying a color value to color the background of the element, which can be expressed in different formats, RGB, RGBA, HSL, or Color names. It can be applied through Inline styling, Internal styling, and External Stylesheet. The background color property with value transparent is default....

Usage of HTML Background Color

HTML Background Color property can be used in 3 ways...

Changing the Background Color

For changing the background color of an HTML element, the background-color property is applied through CSS styling. The property can be applied with different color values like HEX, RGB, Named, and HSL and with various ways including inline, internal, and external styling....

Browser Compatibility

...