English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Basic Tutorial

HTML media

HTML reference manual

HTML5 Basic Tutorial

HTML5 API

HTML5 Media

HTML Titles

In an HTML document, titles are important, and it is equally important to use titles correctly.

HTML Titles

Titles (Headings) are defined by <h1> - <h6> Tag is defined.

<h1> Defines the largest title. <h6> Defines the smallest title.

<h1>I am a title1 h1</h1>
<h2>I am a title2 h2</h2>
<h3>I am a title3 h3</h3>
<h4>I am a title4 h4</h4>
<h5>I am a title5 h5</h5>
<h6>I am a title6 h6</h6>
Test to see ‹/›

Comments: When running html, browsers will automatically add blank lines before and after the title.

Titles are important

Please make sure to use the HTML title tag only for titles. Do not use titles just to generate bold or large text.

Search engines use titles to index the structure and content of your web page.

Because users can quickly judge the content and theme of your web page through the title, it is very important to present the document structure with titles.

Should use h1 Used as main title (most important, with the highest weight), followed by h2(Less important), followed by h3and so on.

HTML Horizontal Line

<hr>or<hr /> Tag creates a horizontal line in an HTML page. The hr element can be used to separate content.

<p>This is a paragraph.</p>
<hr>
<p>This is a paragraph.</p>
<hr />
<p>This is a paragraph.</p>
Test to see ‹/›

HTML Comments

Comments can be inserted into HTML code to improve readability and make the code easier to understand. Browsers will ignore comments and not display them.

The writing style of comments is as follows:

<!-- This is a comment -->
Test to see ‹/›

Comments: A exclamation mark must follow the opening parenthesis (the left parenthesis) immediately after the start parenthesis, and there is no need for one before the closing parenthesis (the right parenthesis). Using comments reasonably can be very helpful for editing and searching HTML code.

HTML Tips - How to View Source Code

You may have seen some well-done website pages, and you may also want to make such effects. Then, if you look at the HTML code of this web page, what will you see.

If you want to view the source code and see how it is implemented, just right-click on the blank space of the web page, then select 'View Source File' (IE) or 'View Page Source' (Firefox), and the method for other browsers is similar. This will open a window containing the HTML code of the page.

This Site Example

Title

How to display titles in an HTML web page.

Hidden Comments

How to comment in HTML source code.

Horizontal Line

How to insert a horizontal line.

HTML Tag Reference Manual

The basic tutorial tag reference manual provides more information about these headings and their attributes.

In the following chapters of this tutorial, you will learn more about HTML tags and attributes.

TagDescription
<html>Define HTML Document
<body>Define the Body of the Document
<h1> - <h6>Define HTML Title
<hr>Define Horizontal Line
<!--...-->Define Comments