Home > Web Front-end > HTML Tutorial > Detailed explanation of the use of title tags and paragraph tags in XHTML_HTML/Xhtml_Web page production

Detailed explanation of the use of title tags and paragraph tags in XHTML_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:36:13
Original
2449 people have browsed it

XHTML Title Overview
When we write Word documents, we often use titles, such as "Chapter 1", "1.2.1", etc. There is also the concept of title in XHTML syntax. Six levels of headings are defined in XHTML, from

to

:

XML/HTML CodeCopy content to clipboard
  1. <h1>First level titleh1>
  2. <h2>Second level titleh2>
  3. <h3>Third level titleh3>
  4. <h4>Fourth level titleh4>
  5. <h5>Fifth level titleh5>
  6. <h6>Sixth level titleh6>

The use of titles
In XHTML documents, titles are very important. Search engines use titles to index the structure and content of your web pages. We must be good at using titles to identify our document hierarchy.
Among the titles, the first level titles are the highest, and then decrease in sequence. Generally speaking, in XHTML documents, the title applies to the following places in the document (within the tag):
According to the website level:

Define the website title

Define article titles
According to website content:

Define website titles

Define article titles
< h3>Define column titles
For h4 to h6 titles larger than h3, you can choose them in appropriate places, such as copyright statements or disclaimer notices and other relatively important places.
Please also note that the levels must be decreasing. The level below h1 should be h2, and then h3...


Some suggestions for using titles
Since h1 represents the core content of the entire page, generally h1 can only appear once (this is not absolutely the case, but it must not appear multiple times) and used in the most emphasized part of the article. Therefore, for specific content pages, h1 is often used in article titles to highlight the importance of the article, such as this site:

XML/HTML CodeCopy content to clipboard
  1. <h1>XHTML Title<h1> 

Whether h1 will be used in the website title (website logo) at this time will depend on the actual situation.
Title usage practice
Open our learning document 1.html file with an editor, copy the above

to

tags into the tag:

XML/HTML CodeCopy content to clipboard
  1. <body>
  2. <h1>First level titleh1>
  3. <h2>Second level titleh2>
  4. <h3>Third level titleh3>
  5. <h4>Fourth level titleh4>
  6. <h5>Fifth level titleh5>
  7. <h6>Sixth level titleh6>
  8. <p>hi~Hello! p>
  9. body>

Save and open the 1.html file with a browser (if it is already open, click the browser refresh button to reload the document, the same below, no further description), you can view the effect of the title tag as follows:
201636113918682.gif (396×290)

As you can see from the example, the browser will automatically form a line break for a title (each title has its own line).

Paragraph p tag
In XHTML, paragraphs are defined through the

tag.
XHTML Paragraph
Paragraph tag example:

XML/HTML CodeCopy content to clipboard
  1. <p>This is a paragraph. p>

In actual production work, we use

paragraph tags extensively.
After adding a paragraph tag to the text, the browser will automatically add a paragraph break to the text. But instead of relying on the empty

to form a blank line, we should use the
line break tag.


Line break

In XHTML documents, the title or paragraph tag only provides a line break mark. If we need a blank line or multiple line breaks, we need Newline tag
. In XHTML, hitting the Enter key to break a new line when editing Word is invalid, and the browser will ignore the new line gap generated in this way.
Example:

XML/HTML CodeCopy content to clipboard
  1. <p>Here are some contentsp>
  2. <br />< br />
  3. <p>This is some other contentp> 

Since the line break tag only informs the browser that a line break is needed in this place without any substantive content, this tag does not appear in pairs, and a
only breaks the line once. If multiple line breaks are needed, please enter Multiple
tags.
If the
tag is inserted into

, it will also produce a line break effect.



or
?
Although we can still achieve line breaks using
, that is the result of the browser being compliant with the HTML4.0 specification.
In the XHTML specification, for tags that are not paired, you only need to add a space after the end of the content, and then use /> to close the tag, such as
and and other tags.
So
instead of
or
.

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