HTML Basics: HTML Content Details

HTML Basics: HTML Content Details
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

Recommend

Springboot+Vue-Cropper realizes the effect of avatar cutting and uploading

Use the Vue-Cropper component to upload avatars. ...

Related commands to completely uninstall nginx under ubuntu16.04

nginx Overview nginx is a free, open source, high...

Installation and configuration of MySQL 5.7.17 free installation version

MYSQL version: MySQL Community Server 5.7.17, ins...

Analysis of several situations where MySQL index fails

1. Best left prefix principle - If multiple colum...

Vue implements simple image switching effect

This article example shares the specific code of ...

Code analysis of user variables in mysql query statements

In the previous article, we introduced the MySQL ...

How to solve mysql error 10061

This article shares with you the solution to the ...

MySQL 8.0.23 Major Updates (New Features)

Author: Guan Changlong is a DBA in the Delivery S...

In-depth analysis of Linux NFS mechanism through cases

Continuing from the previous article, we will cre...

Database query optimization: subquery optimization

1. Case Take all employees who are not the head o...

Vue+Router+Element to implement a simple navigation bar

This project shares the specific code of Vue+Rout...

How to enter directory/folder in Linux without using CD command

As we all know, without the cd command, we cannot...

How to view the storage location of MySQL data files

We may have a question: After we install MySQL lo...

How to configure Nginx domain name rewriting and wildcard domain name resolution

This article introduces how to configure Nginx to...

The front-end must know how to lazy load images (three methods)

Table of contents 1. What is lazy loading? 2. Imp...