The paragraph formatting tags in HTML


In the previous article, Taimienphi.vn introduced you to Heading tags in HTML, in the next article below, Taimienphi.vn will introduce you about paragraph formatting tags in HTML.


Card p in HTML is used to identify the paragraph. Refer to the following article of Taimienphi.vn to learn about paragraph formatting tags in HTML.

The paragraph formatting tags in HTML

Table of contents

1. The tag formats the text in the HTML

2. Display HTML tags

3. The closing tag in HTML

4. The line break tag in HTML

5. Display poems in HTML

6. The pre element is in HTML

7. The paragraph formatting tags in HTML

1. The tag formats the text in the HTML

As mentioned above, the tag p in HTML is used to identify the paragraph. Any content mentioned in tags p and close p are considered paragraphs.

Most browsers read a line as a paragraph of text even when we don’t use the closing tag, namely the tag. p. However sometimes this can cause errors, so the general convention is that we must use the closing tag.

For example: Here is an example of HTML format tags:

The text is in text in html

After applying the paragraph p tag, the result will look like this:

the text is in html 2

2. Display HTML tags

About how the HTML tags are displayed:

– On large or small screen sizes, and on resizable windows, results will be displayed in a variety of ways.

– With HTML, we cannot change the output by adding spaces or lines in the HTML code.

The browser will remove extra spaces and lines when the page is displayed.

For example: The following example illustrates how the HTML tag displays.

The text is written in html 3

The output will look like the following:

the text is in html 4

3. The closing tag in HTML

Most browsers will display HTML properly even if we forget to use the closing tag.

However, Taimienphi.vn recommends that you should still use the closing tag to avoid possible errors.

For example:

the text is in html 5

The output will look like the following:

the text is in html 6

4. The line break tag in HTML

Card br in HTML is used to break the line.

For example: The following example uses br tag to break a line:

The text is in text 7

The output will look like the following:

the text is in html 8

Note: Card br is a blank tag, which means we don’t need a closing tag.

5. Display poems in HTML

For example: In the example below, the sentences in the poem will be displayed on a single line.

the text is in html 9

The output will look like the following:

The text is in html 10

6. The pre element is in HTML

Element pre in HTML defines preformatted text.

Text in the element pre displayed in a font (usually a Courier font) of a fixed width, with no spaces and line breaks.

For example: In the example below, we use the pre element:

the text is in html 11

The output will look like the following:

the text is in html 12

7. The paragraph formatting tags in HTML

Here is a list of paragraph formatting tags in HTML:

the text is in html 13

Description Card

p Identify the paragraph.

p Insert a line break.

pre Defines preformatted text

The above article Taimienphi.vn has just introduced you to the paragraph formatting tags in HTML. In addition, if you have any questions or questions, you can leave your comments in the comment section below the article.

https://thuthuat.taimienphi.vn/the-dinh-dang-doan-van-ban-trong-html-49963n.aspx
In the next articles, Taimienphi.vn will introduce you further style attributes in HTML.

.

Add a Comment

Your email address will not be published. Required fields are marked *