Table of Contents

W3.CSS Background colors

  • The w3-color classes set the background color for any HTML element.
Example
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<link rel="stylesheet" href="w3.css">
<body>

<div class="w3-container">
<h1>Background Colors</h1>
<p>The w3-color classes is used for background colors for HTML elements:</p>
</div>

<div class="w3-container w3-blue">
<h2>Varanasi</h2>
<p>Varanasi is the most populous city in the India.</p>
</div>

<div class="w3-container w3-gray">
<h2>Varanasi</h2>
<p>Varanasi is the most populous city in the India.</p>
</div>

<div class="w3-container w3-grey">
<h2>Varanasi</h2>
<p>Varanasi is the most populous city in the India.</p>
</div>

<div class="w3-container w3-yellow">
<h2>Varanasi</h2>
<p>Varanasi is the most populous city in the India.</p>
</div>

<div class="w3-container w3-teal">
<h2>Varanasi</h2>
<p>Varanasi is the most populous city in the India.</p>
</div>

</body>
</html>