Background Color - HTML

The background color of an element is the color of the virtual page that the element is rendered upon. For example, Shows two paragraphs—the first has a default white background, and the second has a light gray background.

Note: Saying that the document has a default color of white is incorrect. Technically, the document will have the color specified in the rendering user agent’s settings. In typical Internet Explorer installations, the color is indeed white.
To specify a background color, you use the background-color property. This property has a format similar to other color setting properties: background-color: color—value;

For example, to set the background of a particular paragraph to blue, you could use the following definition:

<p style=“background-color: blue; color: white”>This paragraph will render as white text on a blue background.</p>

Note: that the definition also sets the color property so the text can be seen on the darker background.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

HTML Topics