Conditional Rendering in React Complete Guide with Examples 2026

Image
  Conditional Rendering in React Conditional Rendering is one of the most useful concepts in React. It means showing different content on the screen depending on a condition. For example: If a user is logged in → show Logout If a user is not logged in → show Login If a student has passed → show Congratulations If a product is available → show Buy Now If data is loading → show Loading... React does not have a separate if rendering tag. Instead, we use normal JavaScript conditions such as if, the ternary operator, &&, and switch to decide what should appear in the UI.

html formatting tags explained with practical examples

Formatting tags in html 


formatting tags in html


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

html formatting tags explained with practical examples


Related Post :-

learn html link tag

how to create checkbox in html

c program to print alphabet p star




e

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example