htmlHow to set the background: 1. Use the bgcolor attribute of the body tag to set the background color; 2. Use the background attribute of the body tag to set the background image; 3. Use the style attribute in the body tag and add "background: Color value/url('picture path')".
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
htmlSet the background
1. The bgcolor attribute of the body tag
bgcolor attribute specification document background color.
Rendering:
#Note: If you use color names, the rendering structures of different browsers are different. If you use RGB codes, Firefox The browser cannot display the correct color.
Tip: If all browsers want to display the same color, use hexadecimal color codes.
2. The background attribute of the body tag
The background attribute specifies the background image of the document.
Rendering:
3. css background attribute
The background attribute is an abbreviation Properties, you can set all background properties in one statement.
The properties that can be set are:
background-color
background-position
background-size
background-repeat
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
This is some text
html video tutorial"
The above is the detailed content of How to set background for html. For more information, please follow other related articles on the PHP Chinese website!