CSS Example: The BODY element

  • 5 January 2021
  • 0 replies
  • 5 views

Badge +1

Here is an example of a style sheet rule that applies to one specific HTML element; the BODY element.

body{
background-color: #FFFFEE; /* almost white */
background-image: url(../images/CompanyLogo.gif);
background-position: 98% 2%;
background-repeat: no-repeat;
}

The background color is set to almost white, and a company logo image is displayed at the right top of each document.

This example also shows how declarations can be grouped, and how comments can be added. Each declaration must be terminated with a semicolon.


0 replies

Be the first to reply!

Reply