Trainer Riad Thalji Website

HTML Tutorial

HTML Tutorial

by Trainer Riad Thalji

Background Coloring

  • Like text, a background can also have color.
  • Background color can be set to any applicable tag, like <div> and <p>.
  • To set a background color for the whole page, make the setting in the body background.
  • If a background color was set in the body, while another background color was set for an inner tag, the priority for the inner tag will apply to that specific tag, and so forth.

For example, see this code:

<!doctype html>
<body style="background-color: lightgray">
<h1 style="background-color: yellow">Background Example </h1>
<p>This paragraph color will be the same like the one set in the body
< i.e. lightgray. </p>
<p style="background-color: lightgreen">While this paragraph's background color will be light green, as inner tag settings has the priority. </p>

The result will be:

Join Our Coming PMP Prep Course

Delivered by Trainer

Riad Thalji