Start with its body:
When enjoying a web page, you usually notice the background of the page first. If there is background music, it will be even more attractive! Yes, so how did these be achieved? Look at the following:
1. Background color
<body bgcolor=red>We found that there is an extra bgcolor that actually means backgroundcolor (backgroundcolor). bgcolor=red sets the background color of the web page to red. Now the colors are generally in the #ff0000 style.
2. Background picture
<body background=back-ground.gif> is the name of the background image. Why do some friends write this way, but the web page does not have a background image? In fact, background.gif is the location of the image relative to this page. For example, if the page you made is placed in c:/my website/, and the background image is placed in c:/my website/images/, then you have to write it like this: <body background=images/back-ground.gif>, pay attention to the difference between the two!
3. Background music
The background music is very different from the two introduced above. Its code is placed in the head of the page <head></head>. Why is it said here? It is because it is also the first information we receive when displaying a web page. Check out its code:
<bgsound src=background_sound.mid loop=-1>
bgsound Needless to mention the background sound, background_sound.mid is the file name of the music, of course, you have to write its relative path (about the relative path, some netizens may not be able to figure it out at once, we will introduce it in other sections)! loop, loop, so what does loop=-1 mean? loop is a property of bgsound, of course src is the same, followed by the property value, then loop=-1 means infinite loop. As long as the page is opened, the music will not stop. loop=1 means looping once, equal to 0 means no looping, haha, it's not simple!
4. Other properties of body: topmargin, leftmargin. When some friends make pages, they feel that the text or form cannot be leaned against the top and left of the browser. What's going on? Because the default values of topmargin and leftmargin are equal to 12 when we use the production software or html language. If you set their value to 0, you can see what effect will be! Compare <body> and <body topmargin=0 leftmargin=0> as follows. Interested friends can set their values at will!
Okay, that’s all for this section! Everyone will have an internship on their computers, haha!