Paragraphs are defined by the <p> tag.
Example<p>This is a paragraph </p>
<p>This is another paragraph</p>
Tip: Forgot to use the end tag will produce unexpected results and errors.
The align attribute HTML4/5 of <p> is deprecated. Please use CSS instead. Paragraphs support event attributes and global attributes
Text alignment in paragraphs<!DOCTYPE html>
<html>
<head>
<style>
h1 {text-align:center;}
p.date {text-align:right;}
p.main {text-align:justify;}
</style>
</head>
<body>
<h1>CSS text-align instance</h1>
<p class=date>March 14, 2015</p>
<p class=main>When I was young, I dreamed of changing the world; when I matured, I found that I could not change the world, I shortened my eyes a little, and decided to change only my country; when I entered my twilight years, I found that I could not change our country, and my last wish was just to change my family, but this was not possible. When I was lying in bed now, I suddenly realized: If I just changed myself at the beginning, then, I might change my family; with the help and encouragement of my family, I might do something for the country; then, who knows? I might even change the world. </p>
<p><b>Note:</b> Reset the browser window size to see how "justify" works. </p>
</body>
</html>
grammar <p align=left|right|center|justify> Attribute value| value | describe |
|---|---|
| left | Left-align text. |
| Right | Right-align text. |
| Center | Center align text. |
| justify | Stretch the rows so that each row can have an equal width (like in newspapers and magazines). |
If you want to have a new line break (new line) without generating a new paragraph, use the <br /> tag:
Example<p>This is<br>a para<br>graph with line breaks</p>
<br /> The element is an empty HTML element. Since closing the tag doesn't make any sense, it doesn't have an end tag.
Tip: When writing address information or writing poetry<br> tags are very useful. Note: Please use the <br> tag to enter blank lines instead of splitting paragraphs. Note: HTML output - Use reminder to determine the exact effect of HTML being displayed. The size of the screen, as well as adjustments to the window, can lead to different results. For HTML, you cannot change the effect of the output by adding extra spaces or newlines to the HTML code. When the page is displayed, the browser removes unnecessary spaces and blank lines from the source code. All consecutive spaces or blank lines will be counted as a space. It should be noted that all consecutive empty lines (new lines) in the HTML code are also displayed as a space. <html>
<body>
<h1>Chunxiao</h1>
<p>
Sleeping in spring will not make you feel dawn
Birds are heard everywhere.
The sound of wind and rain comes at night,
How many flowers fall?
</p>
<p>Note that the browser ignores the typography in the source code (omitting extra spaces and line breaks). </p>
</body>
</html>
Outputspring dawn
I sleep in spring without realizing the dawn, and I hear birds singing everywhere. The sound of wind and rain comes at night, and how many flowers fall.
Note that the browser ignores the typography in the source code (omitting extra spaces and line breaks).
The above basic HTML summary and recommendation (paragraph) is all the content shared by the editor. I hope it can give you a reference and I hope you can support Wulin.com more.
Original address: http://www.cnblogs.com/sxtywjx/archive/2016/07/13/5665124.html