HTML Basics Summary < paragraph >

Source: Internet
Author: User

HTML Paragraph

The paragraph is defined by the <p> tag.

Example <p>this is a paragraph </p>
<p>this is another paragraph</p> tip: forgetting to use the end tag can produce unexpected results and errors.

The Align attribute HTML4/5 for <p> has been deprecated. Please use CSS instead. Paragraph supports event properties and global properties

text alignment in a paragraph

<! DOCTYPE html>
<style>
h1 {Text-align:center;}
p.date {text-align:right;}
P.main {text-align:justify;}
</style>

<body>
<p class= "Date" >2015 March 14 </p>
<p class= "main" > "When I was young, I dreamed of changing the world, and when I was mature, I found that I could not change the world, I had shortened my eyes, and decided to change only my country; When I came into my twilight years, I found that I could not change our country, My last wish was only to change my family, but that was not possible. When I was lying in bed, dying, I suddenly realized: if at first I just changed myself, then I could change my family, and with the help and encouragement of my family, I might do something for my country; and who knows? I may even change the world. "</p>
<p><b> Note:</b> Reset browser window size View &quot;justify&quot; How it works. </p>
</body>

Syntax <p align= "Left|right|center|justify" > Property values
value Description
Left Aligns the text to the left.
Right Aligns the text to the right.
Center Aligns the text in the center.
Justify Stretch the rows so that each row can have equal widths (like in newspapers and magazines).

HTML Wrapping

If you want to wrap (a new line) without creating a new paragraph, use the <BR/> Label:

Example <p>this is<br>a para<br>graph with line breaks</p>

The <br/> element is an empty HTML element. Because the close tag doesn't make any sense, it doesn't have an end tag.

Tip: <br> tags are useful when writing address information or writing poetry.
Note: Use the <br> tag to enter a blank line instead of splitting the paragraph.
Comments: HTML output-Using reminders
We cannot determine the exact effect of HTML being displayed. The size of the screen, as well as the adjustment of the window, can result in different results.
For HTML, you cannot change the effect of the output by adding extra spaces or line breaks in the HTML code.
When a page is displayed, the browser removes extra spaces and blank lines from the source code. All contiguous spaces or blank lines are counted as a single space. Note that all consecutive empty lines (line breaks) in the HTML code are also displayed as a single space.

<body>

<p>

Spring sleep does not feel Xiao,
Birds are heard everywhere.
Night comes the sound of wind and rain,
How much does the flower fall to know.
</p>

<p> Note that the browser ignores the layout in the source code (omitting extra spaces and line breaks). </p>

</body>

Output Dawn

Spring sleep does not feel xiao, everywhere smell bird. The night comes the wind and rain, the flowers fall to know how much.

Note that the browser ignores the layout in the source code (omitting extra spaces and line breaks).

HTML Basics Summary < paragraph >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.