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

May 16, 2016 pm 04:41 PM
html basic grammar

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.

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles