How To Change The Background Of The Site

Table of contents:

How To Change The Background Of The Site
How To Change The Background Of The Site

Video: How To Change The Background Of The Site

Video: How To Change The Background Of The Site
Video: Change Photo Background Online by Website Free | Photo Editing Website 2024, December
Anonim

If the background of the pages of your site consists of one picture, which has the width of the site and is multiplied vertically, then you can change it only by editing this picture in a graphics editor. And if the background is formed in the code of the pages, then they can be changed using the instructions below.

How to change the background of the site
How to change the background of the site

Instructions

Step 1

To change the background, you first need to determine how it is set in the current version of the site pages. To do this, open the source code of the page on the server. This can be done with an ordinary text editor, a standard Notepad will do. And if you use any content management system, then the page can be edited directly in the browser using the built-in page editor. The HTML code of the page (HTML - HyperText Markup Language, "hypertext markup language") consists of lines with instructions for the browser describing the types, the appearance and layout of each element of the web page. These instructions are called "tags" and they are grouped into blocks, one of which starts with a start tag and ends with an end tag. According to HTML standards, you can set page background parameters in the opening tag. This is done by placing the bgcolor attribute in it: Here the background color of this page is set to green. Some colors according to HTML standards have their own names - for example, Chocolate or Gainsboro, but usually use hexadecimal color codes: If the background color is specified in this way, you should find the body tag in the page code and replace the value of the bgcolor attribute with the one you want.

Step 2

Pages with a more complex design often use CSS (Cascading Style Sheets) to describe the appearance. CSS is a language designed specifically to describe the appearance of elements in an html document. Blocks of CSS code can either be included in the page code, contained in a separate file with the "css" extension and connected to the page with a special instruction in the page source code. You should find the tag in the page code - if it will refer to an external file, then you need open this file for editing. Such a link may look like this: @import "style.css"; And if the tag is immediately followed by instructions, and not a link to the file, then you need to edit the styles here. In both cases, you need to look for that part of the description of styles that refers to the body of the document - body. But in the CSS language, this will no longer be called a "tag" but a "selector", and it may look, for example, like this:

body {

background-color: Green;

color: White;

}

You need to replace the value of the background-color parameter - it sets the background color of the page. And here, too, it is possible to indicate some color shades by name, but it is better to use hexadecimal values. For example, the hexadecimal value for the shade Chocolate = # D2691E. It is possible to specify not only the color, but also the image for the background: body {

background: Green url (img / bg.jpg) repeat-x;

color: White;

} Here url (img / bg.jpg) means that a picture named bg.jpg

Recommended: