HTML Paragraphs
The Paragraph (<p>) Tag
The paragraph element is used to define a single paragraph. Each paragraph element will be displayed below the previous one on a new line.
Html Code:
<p> This is a paragraph the text within it will be treated as an individual unit, otherwise known as a paragraph. The text will wrap around to the next line when it reaches the right edge of the paragraphs container. </p> <p> When I end the paragraph, the line will be stopped and then the next paragraph will start on a new line. Now you know. </p>
Browser Display:
This is a paragraph the text within it will be treated as an individual unit, otherwise known as a paragraph. The text will wrap around to the next line when it reaches the right edge of the paragraphs container.
When I end the paragraph, the line will be stopped and then the next paragraph will start on a new line. Now you know.
You can use the "align" attribute to make the text in a paragraph centered, to the right or left or to justify it where it will be spread out evenly on the line. Though the align attribute has been pushed aside in favor of CSS aligning properties, this will help show the usage of an attribute.
Html Code:
<p align="right"> The text in this paragraph will be aligned to the right side of the paragraph </p> <p align="center"> This text will be centered </p> <p align="justify"> This text will be justified across the paragraph </p>
Browser Display:
The text in this paragraph will be aligned to the right side of the paragraph
This text will be centered. You might find it necessary to do this from time to time. If so, now you know how!
This text will be justified across the paragraph making the right and left margins equal and even so that it looks neat. The only problem is that it will have uneven spacing between the words, some times making it hard to read, but not always
The preferred method to align text by the latest standards is to use Cascading Style Sheet (CSS) properties. This is done with the style attribute using the "text-align" CSS property. For more information on CSS visit our CSS Tutorials.