<

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>
<html>
<body style="background-color: lightgray">
<h1 style="background-color: yellow">Background Example </h1>
<div>
<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>
</div>
</body>
</html>

The result will be:






From the Video Library

How to Create Multi-Lingual Navbars in ASP.Net Core 2.1

How to Create Multi-Lingual Navbars in ASP.Net Core 2.1 | Advanced Programming Series | Riad Thalji

How to Create Multi-Lingual Navbars in ASP.Net Core 2.1

How to Quickly Import Data between Excel, Access and SQL Server

Project Management Office - PMO

Project Managemenet Office - PMO Crash Course

Project Management Office - PMO

How to Create Nested Layouts in ASP.Net Core 2.1 | Advanced Programming Series | Riad Thalji

Developed by Thalji.net, © Riad Thalji