search
HomeWeb Front-endHTML TutorialHTML basic syntax is convenient for friends who have just started learning html_HTML/Xhtml_web page production

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.
 
    ...There is a numbered 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:
    HTML basic syntax is convenient for friends who have just started learning html_HTML/Xhtml_web page production: 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>.....> ; is the most important and commonly used tag in the title area of ​​html files. Other tags in the title area include , , , , , etc.
     The purpose of the 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
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
How can you validate your HTML code?How can you validate your HTML code?Apr 24, 2025 am 12:04 AM

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.