When we define a background style, we often write this as follows:
The code is as follows: |
Copy code |
Body { Background: url (img/header_top.gif) left top no-repeat; }
|
For example, we want to define a background color and add a color to the background, note that if you want to use the background-color style, do not place the style before the background style:
The code is as follows: |
Copy code |
Body { Background-color: red; Background: url (img/header_top.gif) no-repeat left top; }
|
The consequence is that there is no background red to show only one picture. I thought it was a BUG and I thought it was the cause. Because the background color in the background style is not defined, it is colorless by default. Because the first line defines the red color and the second line defines the colorless color, the second line is executed.
Pay attention to this problem when defining background in the future.