The background



Open the file of your HTML page for editing in your editor. For this you can right-click on the document and choose "Open with".

The structure of the HTML file is a series of descriptors of different levels and purposes. Page code usually begins with <html></html>. After it, usually there is a section <head></head>, which specifies the page title and CSS code. After closing the handle starts the body of the page <body></body>. An attribute to define the background of a page is exposed as additional background for this tag. The code to create a background page will look like the following:

<body background = “path to image file”>

The path to the picture can be a URL (starting with http://). Placement can be specified with the root directory (/root/folder/background.jpg) and relative to the location of the editable HTML document (for example, folder/background.jpg).

Save your changes and open the page in the browser. To do this, right-click and select "Open with". In the offered list, specify the name of the software you use to view pages on the Internet. If the background was set correctly you'll see the previously specified background image. If the picture is not displayed, check the correctness of a background attribute and the path to the file in the background.

The parameter bgcolor



To set the background color without a picture, you can use the Directive bgcolor. The value for this attribute you can specify a color name in English or use a color value in the palette HTML. For example:

<body bgcolor = “blue”>

This code sets the page a blue background. If you want to specify a shade of color or a more accurate color, use values, HTML palettes:

<body bgcolor=”#002902”>

In this case, #002902 is a color that you want to give the page.

CSS attributes



You can also set the background using CSS code, written in the <body>:

<body style=”background-color: #E09255”>

With CSS you can specify background image for the page using background-image:

<body style=”background-image: url(putdocument)”>

Using CSS and HTML gives the same results, but setting the display options page, it is preferable to use CSS.