The <p> element offers a way to structure your text. Each paragraph of text should go in between an opening <p> and closing </p> tag as shown below in the example:
<p>Here is a paragraph of text.</p>
<p>Here is a second paragraph of text.</p>
<p>Here is a third paragraph of text.</p>
<p>Here is a paragraph of text.</p>
<p>Here is a second paragraph of text.</p>
<p>Here is a third paragraph of text.</p>
This will produce following result:
Here is a paragraph of text.
Here is a second paragraph of text.
Here is a third paragraph of text.
Paragraph Alignment:
<p align="left">This is left aligned.</p>
<p align="center">This is center aligned.</p>
<p align="right">This is right aligned.</p>
<p align="justify">This is jutified. This works when you have multiple lines in your paragraph and you want to justfy all the lines so that they can look more nice.</p>
This will produce following result:
This is left aligned.
This is center aligned.
This is right aligned.
This is justified.
Here is a paragraph of text.
Here is a second paragraph of text.
Here is a third paragraph of text.
Paragraph Alignment:
<p align="left">This is left aligned.</p>
<p align="center">This is center aligned.</p>
<p align="right">This is right aligned.</p>
<p align="justify">This is jutified. This works when you have multiple lines in your paragraph and you want to justfy all the lines so that they can look more nice.</p>
This will produce following result:
This is left aligned.
This is center aligned.
This is right aligned.
This is justified.
This works when you have multiple lines in your paragraph and you want to justify all the lines so that they can appear in good manner.
Create Line Breaks
Whenever you use the <br /> element, anything following it starts on the next line. This tag is an example of an empty element, where you do not need opening and closing tags, as there is nothing to go in between them.
Note: The <br /> element has a space between the characters br and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <br> it is not valid in XHTML
Example:
Hi<br/> How are you? We miss you<br/>Waiting for your Reply<br/>Best Wishes<br />
This will produce the following result:
Hi
How are you? We miss you
Waiting for your Reply
Best Wishes
Create Line Breaks
Whenever you use the <br /> element, anything following it starts on the next line. This tag is an example of an empty element, where you do not need opening and closing tags, as there is nothing to go in between them.
Note: The <br /> element has a space between the characters br and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <br> it is not valid in XHTML
Example:
Hi<br/> How are you? We miss you<br/>Waiting for your Reply<br/>Best Wishes<br />
This will produce the following result:
Hi
How are you? We miss you
Waiting for your Reply
Best Wishes
No comments:
Post a Comment