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.

What is CSS Outline Width ,Syntax, Values & Examples

What is CSS Outline Width? Syntax, Values & Examples

css Outline width property explained

This Blog You Will Learn
 à®ƒ  What is CSS outline width
 à®ƒ  Syntax:
 à®ƒ  CSS Outline Width Property  Program 
 à®ƒ  Syntax:
 à®ƒ  CSS Outline Width Property  Program 
 à®ƒ  structure diagram examples
 à®ƒ  Explain Program
 à®ƒ  Output

What is CSS outline width

✔ Outline-width property in css defines thickness of the outline drawn around element.

✔ Outline is a line that appears  outside the border  of an element.

✔ Mainly use highlight elements especially for focus states 

Syntax:

selector
{
outline-width: value;
}

outline to appear

outline-style: value;


ஃ structure diagram examples
What is CSS Outline Width ,Syntax, Values & Examples
CSS Outline Width Property 

Program 

<!DOCTYPE html>
<html>
<head>
<style>
p {
  padding: 5px;
  outline-style: solid;
  outline-color: blue;
}

p.box1 {
  outline-width: thin;
}

p.box2 {
  outline-width: medium;
}

p.box3 {
  outline-width: thick;
}

p.box4 {
  outline-width: 8px;
}
</style>
</head>
<body>

<h2>CSS Outline Width Property Explained</h2>

<p class="box1">CSS Outline Property - thin.</p>
<p class="box2">CSS Outline Property -  medium.</p>
<p class="box3">CSS Outline Property - thick.</p>
<p class="box4">CSS Outline Property - 8px thick.</p>

</body>
</html>

CSS Outline Width Property Explained
Explain Program

Step  1] 

<!DOCTYPE html>

  • This declare the document type.
  • browser that the document is written in html

Step 2 

<html>.... . </html>

  • html is the root element of the html page.
  •  Every thing inside it is part of the webpage.

Step 3]

<head>

  • <head> section  contains metadata and css styles,not visible content.

  • Contains styles, metadata and page setting 

Step 4

<style> tag Internal CSS Section

p {
  padding: 5px;
  outline-style: solid;
  outline-color: blue;
}

Padding : 5px;

  •  Add space inside paragraph.
  • creates space between text and outline.

outline-style: solide;

  • outline visible.

outline-color: blue;

  • set outline color to blue.

Outline Width Classes


p.box1 {
  outline-width: thin;
}

  • sets outline thickness to thin.
  • predefined keyword.


p.box2 {
  outline-width: medium;
}

  • set outline thickness  to medium.
  • Medium is the default value.


p.box3 {
  outline-width: thick;
}

  • sets outline thickness to thick.
  • makes outline wider.


p.box4 {
  outline-width: 8px;
}

  • Sets customer thickness use 8 pixels.
  • This fixed size value.

Step 4

Closing tag
</style>
</head>

Step 5

Body Section


<body>

<h2>CSS Outline Width Property Explained</h2>

  • Display heading on webpage.


<p class="box1">CSS Outline Property - thin.</p>
<p class="box2">CSS Outline Property -  medium.</p>
<p class="box3">CSS Outline Property - thick.</p>
<p class="box4">CSS Outline Property - 8px thick.</p>

  • Each paragraph use different class.
  • Each class applies a different outline-width value.

Step 6]

Closing tag


  </body>
</html>

CSS Outline Width Property Explained

Output

CSS Outline Width Property Explained


Related Post :-



Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example