Let's start with the body: When viewing a web page, the first thing you notice is usually the background of the page. If there is background music, it will be even more attractive! Really? Then how are these achieved? See below: 1. Background color <body bgcolor="red">We found that the additional bgcolor actually means backgroundcolor. bgcolor="red" sets the background color of the webpage to red. Now the color is generally in the #ff0000 style. 2. Background image In <body backgroud="back-ground.gif">, "backgroud" is used to set the background image, and background-ground.gif is the name of the background image. Why do some friends write it in this way, but there is no background image on the webpage? In fact, background-ground.gif is the position of the image relative to this page. For example, if you put this page in c:\my website\ and the background image is in c:\my website\images\, then you have to write it like this: <body backgroud="images\back-ground.gif">. Pay attention to the difference between the two! 3. Background music Background music is very different from the two introduced above. Its code is placed in the header of the page <head></head>. Why is it mentioned here? This is because it is also the first information we receive when displaying a web page. Take a look at its code: <bgsound src="background_sound.mid" loop="-1"> bgsound is the background sound, needless to say, background_sound.mid is the file name of the music, and of course you also have to write its relative path (about the relative path, some netizens may not understand it at once, we will introduce it in other sections)! loop, loop, then what does loop="-1" mean? loop is an attribute of bgsound, and of course src is also one of them. The attribute value follows it, so loop="-1" means an infinite loop. As long as the page is open, the music will not stop. loop="1" means it loops once, and 0 means it does not loop. Haha, simple, isn't it! 4. Other attributes of body: topmargin, leftmargin. Some friends feel that when making a web page, the text or table cannot be placed at the top or leftmost edge of the browser. What's going on? Because the default topmargin and leftmargin values of the production software or HTML language we use are usually 12. If you set their values to 0, see what the effect will be! Compare <body> and <body topmargin=0 leftmargin=0> as follows. Friends who are interested can set their values at will! Okay, that’s all for this section! Everyone can practice it on your own computer, haha! |
<<: VMware Workstation Pro 16 Graphic Tutorial on Building CentOS8 Virtual Machine Cluster
>>: Detailed explanation of MySQL 8.0 atomic DDL syntax
Use the Vue-Cropper component to upload avatars. ...
nginx Overview nginx is a free, open source, high...
MYSQL version: MySQL Community Server 5.7.17, ins...
1. Best left prefix principle - If multiple colum...
This article example shares the specific code of ...
In the previous article, we introduced the MySQL ...
This article shares with you the solution to the ...
Author: Guan Changlong is a DBA in the Delivery S...
Continuing from the previous article, we will cre...
1. Case Take all employees who are not the head o...
This project shares the specific code of Vue+Rout...
As we all know, without the cd command, we cannot...
We may have a question: After we install MySQL lo...
This article introduces how to configure Nginx to...
Table of contents 1. What is lazy loading? 2. Imp...