In the previous post we learn about what are the advantages and disadvantages of HTML.In this post we are learning what is paragraph tag and How to create a paragraph in HTML.
- This is a paragraph tag that start with <p> and ends with </p>.
- This is a paired tag.
- When we use <p> tag element it will be structure your document into different paragraph.
- A paragraph can be created by enclosing text within paragraph codes <p>.....</p>.
- we must specially define a paragraph in the code by using a paragraph tag.
- In HTML <p> element represent a paragraph text.
- If we add number of empty lines in paragraph then browser will ignore that lines.
- If we add lot of spaces in the paragraph then browser will ignore the spaces.
Attributes of paragraph tag:
ALIGN:
This attribute is used to where the text appear on the screen.The values are LEFT, RIGHT, CENTER. Default is LEFT.
Example: <P ALIGN="CENTER">
WIDTH:
This attribute is used to specify the horizontal width of a paragraph (one line width).
Example: <P WIDTH=255>
STYLE:
This attribute is used to apply formating to paragraph text.
Example: <P STYLE="background:red; color: yellow">
TITLE:
This attribute is used as tool tip text when mouse is point to the paragraph.
Example:<P TITLE ="Text">
Example of paragraph tag:
ALIGN:
This attribute is used to where the text appear on the screen.The values are LEFT, RIGHT, CENTER. Default is LEFT.
Example: <P ALIGN="CENTER">
WIDTH:
This attribute is used to specify the horizontal width of a paragraph (one line width).
Example: <P WIDTH=255>
STYLE:
This attribute is used to apply formating to paragraph text.
Example: <P STYLE="background:red; color: yellow">
TITLE:
This attribute is used as tool tip text when mouse is point to the paragraph.
Example:<P TITLE ="Text">
Example of paragraph tag:
<html> <head> <title>Demo of paragraph</title> </head> <body> <p>This is first paragraph</p> <p>This is second paragraph</p> </body> </html>
The above example will produce following output:This is first paragraph
This is second paragraph
0 comments:
Post a Comment