Home > Web Front-end > HTML Tutorial > HTML basic syntax is convenient for friends who have just started learning html_HTML/Xhtml_web page production

HTML basic syntax is convenient for friends who have just started learning html_HTML/Xhtml_web page production

WBOY
Release: 2016-05-16 16:41:03
Original
1322 people have browsed it

1.1 General tags
General tags are composed of an opening tag (Opening Tag) and an ending tag (Ending Tag). The syntax is: Controlled text< ;/x>
Where, x represents the tag name. and are like a set of switches: the start tag is to turn on (ON) a certain function, and the end tag (usually the start tag plus a The slash /) indicates the OFF function, and the controlled text information is placed between the two marks. For example: This is italics.
Some attributes can also be attached to the tag to achieve certain special effects or functions. For example: Controlled text
Where, a1,a2,...,an is the attribute name, and v1, v2,...,vn are the corresponding attribute values. The attribute values ​​are acceptable in all browsers currently used, with or without quotation marks. However, according to the new W3C standard, the attribute value is Quotation marks are required, so it is best to develop the habit of adding quotation marks.
 1.2 Empty tags
Although most tags appear in pairs, some exist alone. These tags that exist alone are called Empty Tags. Its AND method is:
Similarly, empty tags can also be attached with some attributes (Attribute) to complete certain special effects or functions. For example: , for example:


,
, etc.
The new standard (XHTML1.0/HTML4.0) defined by W3C recommends that empty tags should end with /, that is:
If additional attributes are:
The browsers currently used do not have strict requirements on whether to add / after the empty tag, that is, at the end of the empty tag, / and Not adding / will not affect its function. But if you want your files to meet the latest standards, it's best to add /.

 2. HTML tag classification
2.1 Document Structure Tags (Document Structure Tags)
The purpose of such tags is to mark out the file Structure, the main ones are:
 ...: Marks the start and end of the html file.
 ...: Marks the file title area.
 ...: Marks the main body area of ​​the file
2.2 Block Formatting Tags (Block Formatting Tags)
The main purpose of such tags is Display a certain section of text in an HTML file in a specific format to increase the visibility of the file. The main ones are:
...: File title.
 ...:i=1,2,...,6, webpage title.
 
: Generate horizontal lines.
 
: Forced line break.
 

...

: Document paragraph.
 
...
: Display in original format.
 
...
: Mark the contact person’s name, phone number, address and other information.
 
...
: Section quotation mark.
 2.3 Character Formatting Tags (Character Formatting Tags)
  It is used to change the appearance of HTML file text and increase the beauty of the file. The main ones are:
 ...: Bold text.
 ...: Italics.
 ...: Type font.
 ...: Change font settings.
 
...
: Center alignment.
 ...: The text blinks.
 ...: Increase the font size.
 ...: Reduce the font size.
 ...: Reference.
 2.4 List Tags
 
    ...
: Unnumbered list.
 
    ... 
  1. ...
  2. : List items.
     
    ...
    : list of definitions.
     
    ...
    : Define the project.
     
    ...
    : Define the project.
     ...: Directory list.
     ...: menu list.
     2.5 Link Tag (Anchor Tag)
    Links can be said to be the lifeblood of HTML hypertext files. HTML uses link tags to integrate images, text, video, audio and other information scattered around the world. The main purpose of such tags is to mark hypertext links (Hypertext Link), mainly including:
    ...: Establish a hyperlink.
     2.6 Multimedia Tag
     This type of tag is used to display image data. Mainly include:
    : embedded image.
     : Embed multimedia objects.
     : Background music.
     2.7 Table Tags
      Such tags are used to create tables. Mainly include:
    ...
    : Define table sections.
     ...: Table title.
     ...: Header.
     ...: Table columns.
     ...: Table cells.
     2.8 Form Tags
    Such tags are used to create interactive forms. The main ones are:
    ...
    : indicates The beginning and end of the form section.
     : Generate single-line text boxes, radio buttons, check boxes, etc.
     : Generates a multi-line input text box.
     : Indicates the start and end of the drop-down list.
     : Generates a selection item in the drop-down list.
    HTML tags are not case-sensitive, that is, and are the same. These tags are introduced below.

     3. File structure mark
    The structure of an html file can basically be divided into two parts, one part is called the title area (Head Section); the other part is called the main area ( Body Section). File structure tags are used to indicate where the header belongs and where the body belongs.
     3.1: Mark the entire document
    Purpose: Mark the entire html document
    Description: A standard html document starts with , and Files ending with . That is:
     
    ... Full text of html file
    : In an html file, the area sandwiched by and is called the title area of ​​the file. Usually the head section is included in the html section, that is:
       ... html file title area
      …..
     
     
    3.3: Web page title<br><br> <title>.....</title> ; is the most important and commonly used tag in the title area of ​​html files. Other tags in the title area include <base>, <isindex>, <link>, <nextid>, <meta>, etc. <br> The purpose of the <title> tag is to set the title of the web page. This title will be displayed on the title bar of the browser window and will not appear in the browser's page text. The My Favorites, BookMark or History List functions of most browsers are also named after the title of this file. <strong> There is no length limit to the text marked by <title>..., but a title that is too long may sometimes be cut off and is not easy to remember.  
    3.4: Mark the main body area of ​​the file

    Description: In the html file, the area sandwiched by ... is called The main body of the file, usually after the section.
     3.5 Attributes of the tag
    backgroud attribute:
    This attribute can specify a graphic file (usually gif or jpeg) as the background pattern. The graphic will be laid out like a tile to form the base image of the entire web page.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template