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.

Top 10 html MCQ with Answers

Top 10 html MCQ with Answers

Top 10 HTML  MCQ With Answers 

Top 10 html MCQ with Answers


1]  CSS  full form?

  1.  color and style sheets
  2. Cascade style sheets
  3. Cascading style sheets
  4. None of the above

Answer: 3) Cascading style sheets

2] Which of the following is the correct syntax for external style sheet?

  1. <style src="example.css>
  2. <style src= example.css>
  3. <stylesheet> example.css </stylesheet>
  4. <link rel="stylesheet" type="text/css" href="main.css">

Answer: 4) <link rel="stylesheet" type="text/css" href="main.css"

3] The property in CSS use to change the background color of element ?

  1. bgcolor
  2. background-color
  3. color
  4. All of the above

Answer: (c) background-color

4] The property in CSS use to change the text color of  element

  1. bgcolor
  2. background-color
  3. color
  4. All of the above

 Answer: 3) color

5) The CSS property use to control the element font-size

  1. text-size
  2. text-style
  3. font-size
  4. None of the above

Answer: 3 ) font-size

6] The HTML attribute use to define the inline styles

  1. styles
  2. style
  3. class
  4. None of the above

Answer: 2) style

7]  The HTML attribute use to define the internal stylesheet

  1. <style>
  2. style
  3. <link>
  4. <script>

Answer: (a) <style>

8] Which of the following CSS property is use to set the background image of element?

  1. background-attachment
  2. background- color
  3. background-image
  4. None of the above

Answer: 3) background-image

9] How to create an unordered list in HTML?

  1. <ul>
  2. <li>
  3. <ol>
  4. <i>

Answer: 1) <ul>

10]  Which character is use to represent the closing of a tag  HTML?

  1. \
  2. !
  3. /
  4. \\

Answer: 3) /


Related Post :-

how to create login form

php program to print hear star pattern

css border property

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example