HTML contains several tags for formatting the text to appear differently than the normal text. Without using CSS we can format text in HTML. Text Formatting elements are designed to display special types of text in HTML web page. 


The most commonly used Text Formatting tags are,

<b> This tag is used to bold the text.

<strong> This element is used to tell the browser that the text is important.

<i>This element is used to make the text italic.

<em>This element is used to display the content in italic.

<u> This element is used to underline the text.

<mark>This element is used to Highlight the text.

<small> This element is used to decrease the font size.

<big> This element is used to increase the font size.

<sub> This element is used to Subscript the text.

<sup> - This element is used to Superscript the text.

<del> This element is used to display the deleted text.

<ins> This element is used to insert the text into existing text.


1. bold <b> Element


The html <b> element is used to display the text in bold font.


Example:

<!DOCTYPE html>

<html>

<title>

  bold Element

</title>

<body>

  <p>This is normal text</p>

  <p><b>This is bold text</b></p>

</body>

</html>


OUTPUT:



2. strong <strong> Element


The HTML <strong> element tells the web browser that the text is important. Typically the text will be displayed in bold.

Example:

<!DOCTYPE html>
<html>
<title>
  Strong Element
</title>
  <body>
    <p>This is normal text</p>
    <p><strong>This is important text(strong text)</strong></p>
  </body>
</html>

OUTPUT:

3. italic <i> Element


The HTML <i> element displays the text in italic font.

Example:

<!DOCTYPE html>
<html>
<body>
  <p>This is normal text</p>
  <p><i>This is italic text</i></p>
</body>
</html>

OUTPUT:

4. Emphasis <em> Element


The HTML <em> element is used to emphasize a particular word within a sentence.

Example:

<!DOCTYPE html>
<html>
  <body>
    <p>This is <b><em>emphasized text</em></b></p>
  </body>
</html>

OUTPUT:


5. Underline <u> Element


The HTML <u>  element show the text as underlined text.

Example:

<!DOCTYPE html>
<html>
  <body>
     <p>This is <b><u>underlined Text</u></b></p>
  </body>
</html>

OUTPUT:

6. mark <mark> Element


The HTML <mark> element is used to mark or highlight a text in a page.

Example:

<!DOCTYPE html>
<html>
  <body>
     <p>This is <mark>HTML5 Tutorial</mark> By SVRR TECH</p>
  </body>
</html>

OUTPUT:

7. small <small> Element


The HTML <small> element is used to make the font size smaller than the other text within a sentence.

Example:

<!DOCTYPE html>
<html>
  <body>
     <p>This is the <b><small>smallest text</small></b></p>
  </body>
</html>

OUTPUT:

8. big <big> Element


The HTML <big> element is used to make the font size bigger than the other text within a sentence.

Example:

<!DOCTYPE html>
<html>
  <body>
     <p>This is the <b><big>biggest text</big></b></p>
  </body>
</html>

OUTPUT:

9. Subscript <sub> Element


The HTML <sub> (Subscript)element will display as, half a character below the other character. For example: " CO2 ".

Example:

<!DOCTYPE html>
<html>
  <body>
    <p>The chemical formula for carbon dioxide is CO<sub>2</sub></p>
  </body>
</html>

OUTPUT:

10. Superscript <sup> Element


The HTML <sup> (Superscript) Element is used to display the text half a character above the normal character. For Example: 25

Example:

<!DOCTYPE html>
<html>
  <body>
     <p>The Equation is x<sup>2</sup> + y<sup>2</sup> + 2xy</p>
  </body>
</html>

OUTPUT:

11. Delete <del> Element


The HTML <del> element is used to delete a text from a sentence.

Example:

<!DOCTYPE html>
<html>
  <body>
     <p>This is <del>Python</del> HTML5 Tutorial</p>
  </body>
</html>

OUTPUT:


12. Insert <ins> Element


The HTML <ins> element is used to insert a text into a sentence. The web Browser will underline the inserted text.

Example:

<!DOCTYPE html>
<html>
  <body>
     <p>This is <del>Python</del> <ins>HTML5</ins> Tutorial</p>
  </body>
</html>

OUTPUT:

Post a Comment

Previous Post Next Post