How To Put A Background On The Site

Table of contents:

How To Put A Background On The Site
How To Put A Background On The Site

Video: How To Put A Background On The Site

Video: How To Put A Background On The Site
Video: HTML u0026 CSS for Beginners Part 13: Background Images 2024, April
Anonim

The working background for the site can be compared to the wallpaper for the desktop of your operating system. Background (background), you can create in several variations, which will be discussed below.

How to put a background on the site
How to put a background on the site

Necessary

Editing the style.css file

Instructions

Step 1

Monochrome background. The simplest kind of background, a big plus is the minimal page load using such a picture. If the style file (style.css) does not contain commands that set the background color, the browser suggests white by default. Use the background-color command to change the color. An example of using this command: background-color: # 3366CC.

Step 2

To select a specific color, you can use special software, for example, the graphics editor Adobe Photoshop. If you have never worked with it, it is recommended to use web services. A striking example is the search engine "Yandex", go to the following link https://yandex.ru and enter the phrase "color blue". A table of colors will appear in front of you, in which you can choose any one to your liking, copy the code and paste it into the site code.

Step 3

Background texture. In addition to the background color, you can add an image or a cyclically repeating pattern (texture) to any page of your site. To do this, after entering the background color, write the background-image command, for example, background-image: url (img / uzor.png). The path to the file must be specified inside the brackets. It is worth noting that the texture resolution can start from the smallest (16x16) and end with full-size images for the size of the site pages (800x600 and more).

Step 4

Background using a gradient. In this case, you are using the background color that was set with the background-color command, but creating a gradient. The gradient can be horizontal (x) and vertical (y). Most often, a horizontal position is used as the background gradient, so the line with the gradient will look like this: background-repeat: repeat-x.

Recommended: