HTML Formatting

HTML Formatting

HTML formatting tags are used to apply various styles and formatting to text and other content on a web page. These tags are used to define the structure and appearance of a web page. HTML formatting tags are enclosed in angle brackets < > and come in pairs, with the opening tag indicating the beginning of the formatting and the closing tag indicating the end of the formatting.

Here are some of the most commonly used HTML formatting tags:

  1. Headings: Headings are used to define the headings and subheadings of a web page. There are six levels of headings, with <h1> being the largest and most important and <h6> being the smallest and least important. Example:
<h1>This is a Heading</h1>

Output:

This is a Heading

  1. **Paragraphs: **The <p>tag is used to define paragraphs. Example:
<p>This is a paragraph.</p>
  1. Bold: The <strong> or <b> tag is used to make text bold. Example:
<strong>This is bold text.</strong>
<b>Bold text</b>

Output: This is bold text. Bold text

  1. Italic: The <em> or <i> tag is used to make text italic. Example:
<em>This is italic text.</em>
<i>Italic text</i>
<p>This is a <em>devsenv</em>website</p>

Output: This is italic text. Italic text

This is a devsenvwebsite

  1. Underline: The <u> tag is used to underline text.
<u>This is underlined text.</u>
<p><u>Underlined</u> text.</p>

Output: This is underlined text.

Underlined text.

  1. Lists: There are two types of lists in HTML: ordered and unordered. Ordered lists are numbered, while unordered lists are bulleted. Example:
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

Output:

  • Item 1
  • Item 2
  • Item 3
<ol>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

Output:

  1. Item 1
  2. Item 2
  3. Item 3

7.Links: The <a> tag is used to create links to other web pages or resources. Example:

<a href="https://www.devsenv.com">Devsenv</a>

Output: Devsenv

8.Strikethrough: To apply a strikethrough effect to text, use the <s> or <strike> tag. Example:

<p>This text is <s>striked through</s>.</p>

Output:

This text is striked through.

9.Superscript and Subscript: To display text as superscript or subscript, use the <sup> or <sub> tag. Example:

<p>This text is in <sup>superscript</sup> and this is in <sub>subscript</sub>.</p>

Output:

This text is in superscript and this is in subscript.

10.Font Color: To change the color of text, use the <font> tag with the color attribute. Example:

<p>This text is <font color="red">red</font> and this is <font color="green">blue</font>.</p>

Output:

This text is red and this is blue.

11.small: In HTML, the “small” element is used to indicate smaller text, typically used for disclaimers or fine print. It can be used within a paragraph or other block-level element to reduce the font size of the enclosed text.

Here is an example of how the “small” element can be used in HTML:

<p>This is a paragraph of regular-sized text. <small>This text is smaller.</small></p>

Output:

This is a paragraph of regular-sized text. This text is smaller.

In this example, the text "This text is smaller." will be displayed in a smaller font size than the surrounding text.

12.big: In HTML, the “big” element is used to indicate larger text, typically used for headings or titles. Example:

<p>This is a paragraph of regular-sized text. <big>This text is bigger.</big></p>

Output:

This is a paragraph of regular-sized text. This text is bigger.

By using HTML formatting tags, web developers can create web pages that are visually appealing, easy to read, and well-organized.

Previous
HTML Paragraph
Next
HTML - Phrase Tags