ad

Saturday, September 6, 2025

html formatting tags explained with practical examples

formatting tags in html 

web designing theory



formatting tags in html 

Html formatting tags are used to make some text on your web pages to appear differently that normal text for better look and feel. In computer application, formatting data may associated with text data to create formatted text or we can say that formatting tags are used to change the style of text on a webpage there are following formatting elements were designed to designed to display special type of text. 


<b>- Bold text

<strong>- Important text

<i>- Italic text

<em>- Emphasized text

<mark > Marked text

<small>- Smaller text 

<del> Deleted text

<ins> Inserted text

<sub> Subscript text

<sup>- Superscript text


formatting tags in html 


<!DOCTYPE html>




<html>

<body><center><strong><u>All Formating tag</u></strong> </center>

<p>This text is normal.</p>                                                                    

<br><i>This text is italic.</i>

<br><em>This text is emphasized.</em>

<br><b>This text is Bold.</b>

<br><strong>This text is Stong.</strong>

 <br>This <sup>text is superscript</sup><br>H <sub>2</sub>

<br><small>This is some smaller</small>

<br><big>This is some smaller</Big> 

<br><Mark>This is some smaller/Mark>

<p>My favorite color is <del>blue</del> red.</p>

 <p>My favorite color is <del>blue</del> <ins>red</ins>.</p>

</html>


formatting tags in html 

Explain Program

Step 1 ]

<!Doctype html>

  •  browser use HTML5.
  • <!doctype html>  always be the first line of any HTML document.

Step 2 ]

   <html> and </html>

   html  is the root element.

Step 3 ]

<body> and </body>

body  is  main content area.

All visible content inside to  the <body> tag

Step 4]

Text Formatting Tags 

<center><strong><u> Formating tag</u></strong></center>

  • <center> :-     Centers the text 
  • <strong>: Makes the text bold and also gives it semantic importance.
  • <u>: Underlines the text.
  • Final result: A bold, underlined, centered title saying "All Formating tag".

Step 5 ]

Paragraphs & Text Styles

<p>This text is normal.</p>

  • Normal paragraph with no styling.

<br><i>This text is italic.</i>

  • <i>: - Italicizes text. Used for stylistic purposes

<br><em>This text is emphasized.</em>

  • <em>: Emphasizes text, typically rendered as italic, but also adds semantic emphasis

<br><b>This text is Bold.</b>

  • <b>: Makes text bold

<br><strong>This text is Stong.</strong>

  • <strong>: Bold with importance

Step 6 ]

Superscript and Subscript

<br>This <sup>text is superscript</sup>

<br>H <sub>2</sub>

  • <sup> :-      Makes text superscript (e.g.like x²)
  • <sub> : - Makes text subscript (like formulas like H₂O)

Step 7]

Text Size

<br><small>This is some smaller</small>

  • Renders the text in smaller size.
  • Renders the text in larger size (note: </Big> should be lowercase: </big>).

<br><big>This is some smaller</Big>

Step 8]

  • <mark>This is some smaller</mark>

Step 9 ]

 Deleted and Inserted Text

<p>My favorite color is <del>blue</del> red.</p>

  • <del>: Strikes through text, indicating deletion.


formatting tags in html 

OUTPUT

Formatting Tag


Related Post :-

learn html link tag

how to create checkbox in html

c program to print alphabet p star




e

No comments:

Post a Comment