How To Fill Background In Html

Table of contents:

How To Fill Background In Html
How To Fill Background In Html

Video: How To Fill Background In Html

Video: How To Fill Background In Html
Video: Full Screen Background Image in Html and Css | Web Zone 2024, May
Anonim

The HTML markup language allows you to make the background of the page a solid color of any color, as well as place images on it. This makes it possible to get text, for example, against a landscape or paper texture.

How to fill background in html
How to fill background in html

Instructions

Step 1

When choosing a background color or image to place on it, be guided primarily by the readability of the text. The background should be contrasting, in other words, the characters should clearly stand out on it. If you decide to make the background graphic, be sure to make sure that you are the author of the image or have the right to use it on the basis of a contract (for example, a free license).

Step 2

Find the tag in the HTML source of the page. To make the background solid and colored, add the bkcolor variable with an argument as a color code. After that, the construction will look like this: <body bkcolor = rrggbb: gt;, where rr, gg and bb are hexadecimal numbers in the range from 00 to FF. The first of them sets the intensity of the red component, the second - to the green, and the third - to the blue.

Step 3

If you want to place an image on the background, first of all, reduce its size so that it has both horizontal and vertical resolutions less than 320 inclusive. Save it as a new file to avoid spoiling the original. Please use JPG,.png

Step 4

Using the web interface or a software FTP client, place the image file in the server folder where the HTML file you are editing is located.

Step 5

Instead of the bkcolor variable, add the background variable to the tag with an argument as the name of the image file. Now it will look like this: where fon

Step 6

Upload the updated HTML file to the server. Open it in a browser. Make sure the background is displayed correctly. If there is an image on it, it will repeat both horizontally and vertically, filling all the space on the page. Check how well the text on the new background reads in different browsers. Use a different color or graphics file if necessary.

Recommended: