Paragraph <p> Tag
<p> is used to define a paragraph in a webpage. We can use Align attribute with it.
When we use <p> tag then by default it aligns the text in left side of the page.
Example:
<p>
This is left align text.</p>
Output
<p align="center">
This is center align text.</p>
Output<p align="right">
This is right align text.</p>
<p align="justify">
This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text.</p>
Output
This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text. This is justifyed align text.
HTML Formatting Elements:
Formatting elements are designed to display special types of text for HTML document.
Tag | Desciption | Effect | |
● | <b> | - Bold text | Bold Text |
● | <u> | - Underline text | Underline Text |
● | <strong> | - Important text | Important text |
● | <i> | - Italic text | Italic Text |
● | <em> | - Emphasized text | Emphasized Text |
● | <mark> | - Marked text | Marked Text |
● | <small> | -Capital to Small text | small text |
● | <del> | - Deleted text | ( |
● | <ins> | - Inserted text | (Inserted text ) |
● | <sub> | - Subscript text | (H2) |
● | <sup> | - Superscript text | (A2) |
Bold Text <b>
If we want to display any text in bold then we use text enclosed with <b>...</b>.
Example
<!DOCTYPE html> <html> <head> <title>Bold Text Example</title> </head> <body> <p> <b>HTML</b> stands for <b>Hyper Text Markup Language</b></p> </body> </html>
Output
HTML stands for Hyper Text Markup Language
Italic Text <i>
If we want to display any text in italicized then we use text enclosed with <i>...</i>.
Example
<!DOCTYPE html> <html> <head> <title>Italic Text Example</title> </head> <body> <p> HTML stands for <i>Hyper Text Markup Language</i></p> </body> </html>
Output
HTML stands for Hyper Text Markup Language
Underlined Text <u>
Anything that appears within <u>...</u> tag, is displayed with underline.
Example
<!DOCTYPE html> <html> <head> <title>Underlined Text Example</title> </head> <body> <p> HTML stands for <u>Hyper Text Markup Language</u></p> </body> </html>
Output
HTML stands for Hyper Text Markup Language
Superscript Text <sup>
The <sup>...</sup> tag is used to place value or text on upper position of normal text.
Example
<!DOCTYPE html> <html> <head> <title>Superscript Example</title> </head> <body> <p> A<sup>2</sup>+B<sup>2</sup></p> </body> </html>
Output
A2+B2
Subscript Text <sub>
The <sub>...</sub> tag is used to place value or text on base position of normal text.
Example
<!DOCTYPE html> <html> <head> <title>Subscript Example</title> </head> <body> <p> H<sub>2</sub>O</p> </body> </html>
Output
H2O
0 Comments