Understand the difference between BR and P tags through examples

Understand the difference between BR and P tags through examples
<br />Use of line break tag<br>The line break tag<br> is a tag without an end. As long as the <br> tag is used anywhere in the HTML file, when the file is displayed in the browser, the text after that position will be displayed on the next line. The <br> tag is the line break tag!
Please note! In a normal text file, just pressing the Enter key on the keyboard will create a line break. However, pressing the Enter key is useless in HTML files. We must use a specific tag <br> to make them create line breaks! example:
The following is the quoted content:
<html>
<head>
<title>Use of br tag</title>
</head>
<body>
Qingping Diao<br>
The clouds are like clothes, the flowers are like faces,
The spring breeze blows through the threshold, and the flowers are in full bloom.
If we had not seen each other on the top of the Jade Mountain,
We will meet under the moon at Yaotai. <br>
</body>
</html>
See what effect will appear~!
Someone may ask how to center the entire poem on the page? If we want to achieve centering, we can use the <p align=center>content</p> we learned before to achieve it!
example:
The following is the quoted content:
<html>
<head>
<title>Use of br tag</title>
</head>
<body>
<p align=center>Qingping Diao<br>
The clouds are like clothes, the flowers are like faces,
The spring breeze blows through the threshold, and the flowers are in full bloom.
If we had not seen each other on the top of the Jade Mountain,
We will meet under the moon at Yaotai. <br>
</p>
</body>
</html>
================================================
Use of paragraph tag <p> The text identified by the <p> tag represents the text of the same paragraph. In browsers, in addition to line breaks, different paragraphs of text are sometimes separated by a blank line to distinguish different paragraphs of text. The syntax is as follows:
<p>Text</p>
But in general applications, a <p> tag is often added only after the text to be divided into paragraphs. For example:
The following is the quoted content:
<html>
<head>
</head>
<title><p>Use of tags</title>
</head>
<body>
Qingping Diao
The clouds resemble clothes, the flowers resemble faces,
The spring breeze blows through the threshold, and the dew is thick.
If we had not seen it on the top of the Jade Mountain,
We will meet under the moon on Yaotai,
</body>
</html>
So what is the difference between <br> and <p>? In layman's terms, when they branch, they divide into rows
<p>The line spacing is relatively large! We can take a look at:
The following is the quoted content:
<html>
<head>
</head>
<title><p>Use of tags</title>
</head>
<body>
Qingping Diao<br>
The clouds are like clothes, the flowers are like faces,
The spring breeze blows through the threshold, and the dew is thick.
If we had not seen it on the top of the Jade Mountain,
We will meet under the moon on Yaotai,
</body>
</html>
This way you can see the effect, can you see it?

<<:  The front end creates and modifies CAD graphics details through JavaScript

>>:  How to install docker using YUM

Recommend

How to use Javascript to generate smooth curves

Table of contents Preface Introduction to Bezier ...

Solution to ERROR 1054 (42S22) when changing password in MySQL 5.7

I have newly installed MySQL 5.7. When I log in, ...

How to update, package, and upload Docker containers to Alibaba Cloud

This time, we will try to package the running con...

Installation tutorial of mysql8.0rpm on centos7

First, download the diagram 1. First uninstall th...

Implementation of building custom images with Dockerfile

Table of contents Preface Introduction to Dockerf...

MySQL full backup and quick recovery methods

A simple MySQL full backup script that backs up t...

18 sets of exquisite Apple-style free icon materials to share

Apple Mug Icons and Extras HD StorageBox – add on...

A question about border-radius value setting

Problem Record Today I was going to complete a sm...

Comparison of the efficiency of different methods of deleting files in Linux

Test the efficiency of deleting a large number of...

MySQL 8.0.2 offline installation and configuration method graphic tutorial

The offline installation method of MySQL_8.0.2 is...

Vue close browser logout implementation example

Table of contents 1. beforeunload event 2. Unload...

How to get the height of MySQL innodb B+tree

Preface The reason why MySQL's innodb engine ...

MySQL implementation of lastInfdexOf function example

Sometimes MySQL needs to use a function similar t...

HTML table tag tutorial (25): vertical alignment attribute VALIGN

In the vertical direction, you can set the row al...