Where x represents the tag name. <x> and </x> are like the same set of switches: the start mark <x> is a function that turns on (ON), and the end mark</x> (usually the start mark plus a slash/) is an OFF function, and the controlled text information is placed between the two marks. For example: <i>This is italics</i>.
Some attributes can also be attached to the mark to complete certain special effects or functions. For example: <x a1=v1,a2=v2,...,an=vn>Controlled text</x>
Among them, a1, a2,...,an is the attribute name, while v1, v2,...,vn is the corresponding attribute value. The attribute value is not quoted or quoted. The browsers currently used are acceptable, but according to the new W3C standard, attribute value must be quoted, so it is best to develop the habit of adding quoted.
1.2 Empty mark
Although most of the marks appear in pairs, some exist alone. These individual tags are called Empty Tags. The method is: <x>
Similarly, empty tags can also be attached with some attributes to complete certain special effects or functions. For example: <x a1=v1,a2=v2,...,an=vn>, for example: <hr>,<br>, etc.
The new standard defined by W3C (XHTML1.0/HTML4.0) suggests that empty tags should end with /, i.e.: <X />
If the attribute is attached, it is: <x a1=v1,a2=v2,...,an=vn />
The browser currently used does not strictly require the addition of / after the empty tag, that is, the / and / after the empty tag will not affect its function. But if you want your file to meet the latest standards, it is best to add /.
2. HTML tag classification
2.1 File Structure Tags
The purpose of this type of tag is to indicate the structure of the file, mainly:
<html>...</html>: indicates the start and end of the html file.
<head>...</head>: indicates the file title area.
<body>...</body>:Displays the main area of the file
2.2 Block Formatting Tags
The main purpose of this type of tag is to display a certain segment of text in an HTML file in a specific format to increase the visibility of the file. The main ones are:
<title>...</title>: File title.
<hi>...</hi>:i=1,2,...,6, web page title.
<hr>: Generate horizontal lines.
<br>: Forced line breaks.
<p>...</p>: File paragraph.
<pre>...</pre>: Displayed in original format.
<address>...</address>: Mark the contact person's name, phone number, address and other information.
<blockquote>...</blockquote>:Segment reference tag.
2.3 Character Formatting Tags
Used to change the appearance of HTML file text and increase the aesthetics of the file. Mainly:
<b>...</b>:Bold characters.
<i>...</i>:Italics.
<tt>...</tt>:Font.
<font>...</font>:Change the font settings.
<center>...</center>:Center align.
<blink>...</blink>:The text is flashing.
<big>...</big>: Increase the font size.
<small>...</small>: Reduce the font size.
<cite>...</cite>:Reference.
2.4 List Tags
<ul>...</ul>:No numbered list.
<ol>...</ol: There is a numbered list.
<li>...</li>: List items.
<dl>...</dl>: List of definitions.
<dd>...</dd>:Define the project.
<dt>...</dt>:Define the project.
<dir>...</dir>:Catalogue list.
<menu>...</menu>: Menu-style list.
2.5 Link Tag (Anchor Tag)
Links can be said to be the lifeblood of html hypertext files. html integrates pictures, texts, movies, audio and other information scattered around the world through link tags. The main purpose of this type of tag is to mark Hypertext Link, mainly:
<a>...</a>: Create a hyperlink.
2.6 Multimedia Tag
Such markers are used to display image data. Mainly:
<img>:Embed into the image.
<embed>:Embed into a multimedia object.
<bgsound>:Background music.
2.7 Table Tags
Such marks are made by making tables. Mainly:
<table>...</table>:Define the table segment.
<caption>...</caption>:Table title.
<th>...</th>:Table header.
<tr>...</tr>:Table column.
<td>...</td>:Table cell.
2.8 Form Tags
This type of tag is used to create interactive forms, mainly:
<Form>...</form>: Indicates the beginning and end of the form section.
<input>: Generate single-line text boxes, radio buttons, check boxes, etc.
<textarea>...</textarea>: Generates multiple lines of input text box.
<select>...</select>: Indicates the beginning and end of the drop-down list.
<option>...</option>: Generate a selection item in the drop-down list.
There is no difference between upper and lower case in HTML tags, that is, <BODY> and <body> are the same. The following are the marks separately.
3. File structure marking
The structure of an html file can basically be divided into two parts, one is called the heading section; the other is called the body section. File structure tags are used to indicate where the title belongs to the subject.
3.1<html>: Label the entire file
Purpose: Label the entire html file
Note: A standard html file is a file that starts with <html> and ends with</html>. Right now:
<html>
... html file full text
</html>
3.2<head>: Label the file title area
Note: In the html file, the area sandwiched by <head> and </head> is called the title area of the file. Usually the head section is contained in the html section, that is:
<html>
<head>
...... html file title area
</head>
.....
</html>
3.3<title>: Web page title
<title>.....</title> is the most important and most commonly used tag in the title area of the html file. Other title areas also include <base>, <isindex>, <link>, <nextid>, <meta>, etc.
The purpose of the <title> tag is to set the web page title. This title will be displayed on the title bar of the browser window and will not appear in the browser page (page) text. Most browsers' collections (My Favorites), Bookmarks (BookMark) or History List functions are named after the title of this file.
There is no length limit for the text marked by <title>...</title>, but a title that is too long may sometimes be cut off and is not easy to remember.
3.4<body>: Label the file main area
Note: In an html file, the area sandwiched by <body>...</body> is called the main area of the file, usually after the <head> section.
3.5 Properties of <body> tag
backgroud attribute:
This property can specify a graphic file (usually gif or jpeg) as the background pattern. The graphics will lay the base image of the entire web page like a piece of ceramic tiles.