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
This article records the installation tutorial of...
Table of contents background analyze method backg...
Preface Swap is a special file (or partition) loc...
Modify /etc/my.cnf or /etc/mysql/my.cnf file [cli...
Inserting Data insert into table name (column nam...
Original address: http://www.webdesignfromscratch...
A jQuery plugin every day - stacked menu, for you...
Preface This article introduces the fifth questio...
Table of contents 1. Scenario 2. Basic functions ...
This article uses examples to illustrate the prin...
Nowadays, whether you are working on software or w...
Ubuntu 18.04, other versions of Ubuntu question: ...
Let me share with you a creative opening realized...
Method 1: Use the SET PASSWORD command MySQL -u r...
Some MySQL tables may contain duplicate records. ...