HTML Text Formating Tags
1. Headings
- Purpose: To structure content with different levels of importance.
- Tags: <h1>, <h2>, <h3>, <h4>, <h5>, <h6> (from largest to smallest heading size)
- Example:
<h1>This is a main heading</h1>
<h2>This is a subheading</h2>
<h3>This is a smaller subheading</h3>
2. Paragraph
- Purpose: To organize text into distinct blocks.
- Tags: <p>
- Example:
<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>
3. Bold
Purpose: To emphasize text by making it appear bolder.
Tag: <b> or <strong> (<strong> is semantically preferred)
Example:
<b>This text is bold.</b>
<strong>This text is also bold (and semantically better).</strong>
4. Italic
Purpose: To emphasize text by making it appear slanted.
Tag: <i> or <em> (<em> is semantically preferred)
Example:
<i>This text is italic.</i>
<em>This text is also italic (and semantically better).</em>
5. Underline
Purpose: To emphasize text by underlining it.
Tag: <u>
Example:
<u>This text is underlined.</u>
6. Strikethrough
Purpose: To visually indicate that text is no longer relevant or accurate.
Tag: <strike> or <s>
Example:
<strike>This text is no longer valid.</strike>
<s>This text is also struck through.</s>