HTML Head Tag/ Element In Hindi

HTML

HTML Head Tag/ Element In Hindi – What is the use of Head Tag/ Element in HTML in Hindi? HTML Mein <Head> Tag Ka Istemal Ek Container Ki Tarah Kiya Jata Hai Jisme “Metadata” Matlab “Data About Data” Hota Hai. <Head> Tag Ka Istemal <Html> Aur <Body> Tags Ke Beech Mein Kiya Jata Hai, Jaisa Ki Neeche Diye Gaye HTML Document Structure Me Dikhaya Gaya Hai:

HTML Head Tag/ Element In Hindi

What Metadata is given Inside the Head Tag?

Head Tag Ke Andar Diya Gya Koi Bhi Content Webpage Par Display Nahi Hota Hai, Woh Bass Webpage Se Related Kuch Important Information Hoti Hai Jisme Neeche Di Gayi Tags Istemal Hoti Hain:

  • <title>
  • <style>
  • <meta>
  • <link>
  • <script>
  • <base>

Neeche Sabhi Tags Ko <Head> Tag Ke Andar Istemal Karna Btaya Gya Hai, Code Ko Copy Karke Khud Practice Karen:

Using <title> tag inside head tag.

Iska Istemal Webpage Ko Title Dene Ke Liye Kiya Jata Hai Jo Browser Ki Tab Aur Search Engine Results Me Display Hota Hai.

Example:

<!DOCTYPE html>
<html>
<head>
  <title>A Meaningful Page Title</title>
</head>
<body>

The content of the document......

</body>
</html>

Output:

The content of the document......

Using <style> tag inside head tag.

Iska Istemal Current Webpage Ki Style Properties Define Karne Ke Liye Kiya Jata Hai.

Example:

<!DOCTYPE html> 
  
<html> 
  
<head> 
    <style> 
        body { 
            background: skyblue; 
        } 
          
        h1 { 
            color: red; 
        } 
          
        p { 
            color: blue; 
        } 
    </style> 
</head> 
  
<body> 
  
    <h1>Master Programming</h1> 
    <p>It is a portal for Computer Science learners.</p> 
  
</body> 
  
</html> 


Output:

Using <meta> tag inside head tag.

Iska Istemal Different Tarah Se Kiya Jata Hai:

  • To Set Character Set
  • To Set Keywords For Search Engines
  • For The Description Of The Webpage
  • Define The Author Of The Webpage
  • To Set The Viewport, Etc..

Example:

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="description" content="Free Web tutorials">
  <meta name="keywords" content="HTML, CSS, JavaScript">
  <meta name="author" content="John Doe">
</head>
<body>
<p>All meta information goes inside the head section.</p>
</body>
</html>

Output:

All meta information goes inside the head section.

Using <link> tag inside head tag.

Iska Istemal External Style Sheets Link Karne Ke Liye Kiya Jata Hai.

Example:

<!DOCTYPE html> 
  
<html> 
  
<head> 
    <link rel="stylesheet" type="text/css" href="mystyle.css"> 
</head> 
  
<body> 
  
    <h1>Master Programming</h1> 
    <p>It is a portal for Computer Science learners.</p> 
  
</body> 
  
</html> 

Output:

Using <script> tag inside head tag.

Iska Istemal Internal Aur External JavaScripts Embed Karne Ke Liye Kiya Jata Hai.

Example:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
  <script>
  function myFunction() {
    document.getElementById("demo").innerHTML = "Hello JavaScript!";
  }
  </script>
</head>
<body>

<h1>My Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>

</body>
</html>

Output:

Using <base> tag inside head tag.

Iska Istemal webpage ke liye base address/ URL set karne ke liye kiya jata hai jisse relative file paths ko open karna easy ho jata hai.

Example:

<!DOCTYPE html>
<html>
<head>
  <base href="https://masterprograming.com/" target="_blank">
</head>
<body>

<h1>The base element</h1>

<p><img src="images/stickman.gif" width="24" height="39" alt="Stickman"> - Notice that we have only specified a relative address for the image. Since we have specified a base URL in the head section, the browser will look for the image at "https://masterprograming.com/images/stickman.gif".</p>

<p><a href="tags/tag_base.asp">HTML base tag</a> - Notice that the link opens in a new window, even if it has no target="_blank" attribute. This is because the target attribute of the base element is set to "_blank".</p>

</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *