background color style code example

Example 1: how to make a background color in html

<body style="background-color: #fff">
  <!---this will change the body color---!>

</body>

Example 2: css background color

body {
  background-color: green;
}

Example 3: css set background color

body {
	background-color: red; 
}

Example 4: background color

//javascript type css:
document.body.style.backgroundColor = "blue";
// or inline css:
<div style="background-color: blue;"></div>

Example 5: how to set background colour i js inline stylel

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Backgorund Color</title>
   </head>
   <body style="background-color:grey;">
      <h1>Products</h1>
      <p>We have developed more than 10 products till now.</p>
   </body>
</html>

Example 6: css background color

body {background-color: coral;}

Tags:

Html Example