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 head Tag

html head Tag           

web designing theory

Head section

   The head section container set of elements that provide the metadata for the document. This the metadata can be specify the title element, character set, author, description or keywords of  web page (meta element), a style sheet or relational information (link element) or embedded style declarations (style element), among others. The presence of  title element is mandatory to the inside the head section of  HTML document. Most metadata  not displayed in the browser (although  title usually appears in the browser's title bar) it can be useful for the functionality of the page.

Syntax:

 The <head> tag is written as <head></head> with the metadata content enclosed between the start and end tags. The <head> tag  placed between  opening and closing <html> tags. Most HTML pages must have a <title> tag within the <head> tag.


<!doctype html>

<html>

<head>

<title> Page ...</title>

</head>

<body>

Page body...

</body>

</html>

the HEAD element, only to the certain elements are allowed. Information to the HEAD element may include to the following elements (arranged alphabetically)

1. Base Element  

The <base> element specifies the base URL and/or target for all relative URLs in a page. It is used either a href or a target attribute present, or both.

 Syntax

<base> is written as <base href="" target="">. It is used either a href attribute or

Example

Specified a default URL and a default target for links on  page: 

<html>

<head>

<base href="http://google.com/docs/mypage.html" target="_blank">

</head>

<body>

<h1>The base element</h1>

<P>the head section</p>

<p> specified a relative address.specified a base URL in head section</p>

<img src="images/about.gif">

</body>

</html>


2. ISINDEX

The ISINDEX element informs to HTML user agent the document is an index document. The document  queried with  keyword search by adding a question mark to the end of the document address, followed by a list of keywords separated by plus signs.The URL use for processing querie can be overrid with the HREF attribute

 <ISINDEX HREF="Personal.db" PROMPT="Enter Surname : ">



Related Post :-

html input type

CSS in combinators

css box 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