HTML 5 – Some important formatting elements
Following are the list of formatting elements:
- Emphasized text
- Marked text
- Small text
- Deleted text
- Inserted text
- Subscripts
- Superscripts
1. Emphasized text– The syntax of the Emphasized text element is <em> which defines emphasized text.
Example:
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML formatting element sample</title>
- </head>
- <body>
- <p>Hi. This is Raj Kumar Beniwal Here (This is normal text) </p>
- <p>
- <em> Hi. This is Raj Kumar Beniwal Here (This is normal text) </em>
- </p>
- </body>
- </html>
2. Marked text– The syntax of marked text element is <mark> which defines marked or highlighted text.
Example:
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML formatting element sample</title>
- </head>
- <body>
- <h2>Hi. This is
- <mark>Raj Kumar</mark> Beniwal Here.
- </h2>
- </body>
- </html>
Output:
3. Small text– The syntax of small text element is <small> which defines small text.
Example:
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML formatting element sample</title>
- </head>
- <body>
- <h1>Hi. This is
- <small>Raj Kumar</small> Beniwal Here.
- </h1>
- </body>
- </html>
Output:
4. Deleted text– the syntax of deleted text is <del> which defines deleted or removed text.
Example:
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML formatting element sample</title>
- </head>
- <body>
- <h1>Hi. This is
- <del>Raj Kumar</del> Beniwal Here.
- </h1>
- </body>
- </html>
Output:
5. Inserted text– the syntax of inserted text element is <ins> which defines inserted or added text.
Example:
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML formatting element sample</title>
- </head>
- <body>
- <h1>Hi. This is Raj
- <ins>Kumar</ins> Beniwal here.
- </h1>
- </body>
6. Subscripts text– The syntax of the subscripts text element is <sub> which defines subscripted text.
Example:
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML formatting element sample</title>
- </head>
- <body>
- <h1>Hi. This is
- <sub>Raj Kumar</sub> Beniwal here.
- </h1>
- </body>
- </html>
Output:
7. Superscripts text– The syntax of superscript text element is (sup> which defines superscripted text.
Example:
- <!DOCTYPE html>
- <html>
- <head>
- <title>HTML formatting element sample</title>
- </head>
- <body>
- <h1>Hi. This is
- <sup>Raj Kumar</sup> Beniwal here.
- </h1>
- </body>
- </html>
Output: