HTML Basic Syntax

Source: Internet
Author: User
Tags format define empty end functions html tags reference tag name
Grammar 1.1 General Mark
A generic tag is composed of a start tag (Opening tag) and an end tag (ending tag) with the syntax:<x> controlled text </x>
where x represents the tag name. <x> and </x> are like a set of switches: The start tag <x> is a function on, and the end tag </x> (usually the start tag plus a slash/) is off function, The controlled text information is placed between the two tags. For example:<i> This is italic character </i>.
Tags can also be attached to some attributes to accomplish certain special effects or functions. For example: <x a1= "v1", a2= "v2",..., an= "vn" > Controlled text </x>
Among them, A1,a2,..., an is the property name, and the V1,v2,..., vn is its corresponding property value, the property value is not quoted, the browser is now acceptable, but according to the new standard of the Web, the property value is to be quoted, so it is best to develop the habit of quoting.
   1.2 Empty marks
Although most of the markers are paired, there are some that are separate. These separate tokens are called empty tags (Empty tags). It is:<x> with the law
Similarly, an empty tag can be attached to some attributes to accomplish certain special effects or functions. such as: <x a1= "v1", a2= "v2",..., an= "vn", such as:The new Standard (xhtml1.0/html4.0) for the definition of the consortium suggests that NULL tags should end with/, i.e.: <x/>
If the attached property is: <x a1= "v1", a2= "v2",..., an= "vn"/>
The browser currently in use has no strict requirements for whether or not to append to the empty tag, that is, the end of the empty tag is/and is not added/, does not affect its function. But if you want your files to meet the latest standards, then it's best to add/.

   2. HTML tag Classification
   2.1 Document Structure mark (document Structure tags)
The purpose of such a tag is to indicate the structure of the document, mainly:
<body>...</body&gt: Mark out the main area of the document
   2.2 Section format mark (block formatting tags)
The main purpose of such a tag is to have a section of text in an HTML file, display it in a specific format, and increase the visibility of the file. The main are:
<title>...</title&gt: File topic.
&LT;HR&GT: Produce horizontal lines.
<br&gt: Forced line wrapping.
&LT;P&GT;...&LT;/P&GT: a document paragraph.
<pre>...</pre&gt: Display in original format.
<address>...</address&gt: Labeling the contact person's name, telephone number, address and other information.
&LT;BLOCKQUOTE&GT;...&LT;/BLOCKQUOTE&GT: Sector reference mark.
   2.3 Character Format tags (Character formatting tags)
Used to change the appearance of HTML file text to increase the beauty of the file. The main are:
<b>...</b>: Bold word.
<i>...</i>: Italic character.
<tt>...</tt&gt: Playing fonts.
<font>...</font&gt: changing font settings.
<center>...</center>: center-aligned.
<blink>...</blink>: Text flashes.
&LT;BIG&GT;...&LT;/BIG&GT: Enlarge the font size.
<small>...</small&gt: Reduce the font size.
<cite>...</cite>: Reference.
   2.4 Listing tags (list tags)
&LT;UL&GT;...&LT;/UL&GT: No numbered list.
<ol>...</ol: There are numbered lists.
<li>...</li&gt: List items.
&LT;DL&GT;...&LT;/DL&GT: List of definitions.
&LT;DD&GT;...&LT;/DD&GT: Define the project.
&LT;DT&GT;...&LT;/DT&GT: Define the project.
<dir>...</dir&gt: Table of Contents list.
<menu>...</menu&gt: Menu-Type list.
   2.5 link mark (anchor tag)
Links can be said to be the lifeblood of HTML hypertext files, HTML through the link tag to integrate the scattered around the world of graphics, text, shadow, sound and other information. The main purpose of such tags is to mark hypertext file links (hypertext link), mainly:
<a>...</a&gt: Create a hyperlink.
   2.6 Multi-media tag (multimedia tag)
This class of tags is used to display image data. The main are:
<embed&gt: Embedding multimedia objects.
<bgsound&gt: Background music.
   2.7 Table tags (table tags)
This type of marking is made with a form. The main are:
&LT;TABLE&GT;...&LT;/TABLE&GT: Defines a table section.
<caption>...</caption&gt: Table title.
<th>...</th&gt: Table head.
<tr>...</tr&gt: Table Columns.
<td>...</td&gt: Table cell.
   2.8 Form Tags (form tags)
This type of markup is used to make interactive forms, mainly:
<form>...</form&gt: Indicates the beginning and end of the form section.
<input&gt: Produces single-line text boxes, radio buttons, check boxes, and so on.
&LT;TEXTAREA&GT;...&LT;/TEXTAREA&GT: produces multiline input text boxes.
<select>...</select&gt: Indicates the beginning and end of the Drop-down list.
&LT;OPTION&GT;...&LT;/OPTION&GT: Produces a Select item in the Drop-down list.
HTML tags are not case-sensitive, that is, <BODY> and <body> are the same. To introduce these tags separately.

   3. File Structure Mark
The structure of an HTML file can basically be divided into two parts, one called the header section and the other part called the main section. A file structure tag is used to indicate where the title belongs, and where it belongs to the subject.
   3.1
Purpose: To mark the entire HTML file
Description: A standard HTML file is a file that starts with a ... HTML file full text
   3.2
Description: In HTML files, the area that is clamped by ... HTML file title area
.....
   3.3<title>: page title
<title>.....</title> is the most important and commonly used tag in the HTML file title area. Other title area tags include <base>, <isindex>, <link>, <nextid>, <meta>, etc.
The purpose of the <title> tag is to set the page title, which appears in the title bar of the browser window and does not appear in the browser's page text. Most of the browser's favorites (my Favorites), bookmark (bookmark), or History list (History list) feature are also named after the title of the file.
The text marked by <title>...</title> has no length limitations, but too long headings can sometimes be truncated and not easily memorized.
   3.4<body>: Mark out the main area of the document
Note: In HTML files, the area that is sandwiched by <body>...</body> is called the main area of the file, usually after the    properties of the 3.5<body> tag
Backgroud Properties:
This property can specify a graphics file (typically GIF or JPEG) as a background pattern. The graphic will be paved as the bottom of the entire Web page like a tiled tile.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.