In the first lecture, we summarized the main framework of the Web page. Now we will study the internal rules of the web page in detail:
Start with its body:
When you enjoy a webpage, you usually first notice the background of this page. If there is background music, it will be more attractive! So how are these implemented? See below:
1. Background Color
<Body bgcolor = "red"> we find that the other bgcolor is actually the meaning of backgroundcolor (background color). bgcolor = "red" sets the background color of the webpage to red, currently, the color is generally # ff0000.
2. Background Image
<Body backgroud = "back-ground.gif"> In the left-side Navigation Pane, back-ground.gif is the name of the background image, why do some friends also write so, but the webpage does not have a background image? The actual back-ground.gif is the position of the image relative to this page. For example, if you place this page on c: \ My website \, and the background image on c: \ My website \ images \, then you have to write this: <body backgroud = "images \ back-ground.gif">, pay attention to the difference between the two!
3. Background Music
The background music is very different from the two mentioned above. Its code is placed in the header of the page <Bgsound src = "background_sound.mid" loop = "-1">
Needless to say, bgsound is the background sound. background_sound.mid is the name of the music file. Of course, you have to write its relative path. (For the relative path, some netizens may not be able to understand it at once, we will introduce it in other sections )! Loop, loop, so what does loop = "-1" mean? Loop is an attribute of bgsound. Of course, src is the same. The following is the attribute value. loop = "-1" means an infinite loop. As long as the page is opened, the music won't stop. loop = "1" indicates loop once. If it is equal to 0, loop is not done. Haha, it's easy!
4. other attributes of the body: topmargin and leftmargin. When some friends make pages again, they feel that the text or table cannot depend on the top and left of the browser. What is going on? Because the default value of the production software or html language is topmargin and leftmargin. If you set their value to 0, you can see what the effect will be! Compare <body> and <body topmargin = 0 leftmargin = 0> as follows. If you are interested, you can set their values at will!
Now, let's start with this section! Practice on your computer!