Understanding Meta Tags in CSS(lt.27)

himanshuhimanshu
2 min read

Introduction:

A meta tag is a snippet of code present in the head section of a web page. It provides information about the page to search engines, influencing how the page is displayed and ranked when searched.

In simple words, it is data about data.

Importance of Meta Tags:

  1. Search Engine Optimization (SEO): They provide the browsers with relevant information about the content of the page. This helps search engines understand the page's topic, and keywords resulting in page ranking.

  2. User Experience: Provide a concise and informative description of the page's content. This leads to an increase in the traffic on the web page.

  3. Controlling Browser Behavior: Certain meta tags can control how browsers display the page, such as specifying the page's character encoding and viewport settings.

Common meta tags:

  1. <meta name="viewport" content="width=device-width, initial-scale=1.0"\>:This instructs the browser to set the viewport width to the device's width , and set the initial zoom level of the page to 1.0, which means the page will be displayed without zooming.

  2. <meta name="description" content=" whatever you want to write"/\>

  3. <meta name="keyword" content="write the keywords here"/>: Keyoword will tell what information the page is holding or the words associated with the website.

  4. <meta http-equiv="refresh" content="Time after which another page will be rendered ; after the time is over the website url given here will be rendered">

Code for it:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="description" content="jo aap likhna chaho"/>
   <meta name="keyword" content="html ,sql"/>
   <meta name="author" content="himanshu"/>
   <meta http-equiv="refresh" content="5 ; url=https://www.google.com/">


    <title>meta</title>
</head>
<body>

</body>
</html>

lt.26: https://hashnode.com/post/clpz1ysjl000108leh9hc6vub

20
Subscribe to my newsletter

Read articles from himanshu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

himanshu
himanshu