Meta tag and it's importance.

Meta tag and it's importance.

Overview: Let's start to understand, What is a meta tag? and How useful is it for developers?

Let's think of one scenario When we search something on Google (or any browser), Have you ever noticed when Google shows our search content, the description comes at the bottom of the content (webpage)? This is possible due to the meta tag.

What is Meta Tag? The meta tag is data about data. we use it inside the <head> tag of HTML. It is a self-closing tag. It can't render on web browsers, only Search Engines (Google, Yahoo, DuckDuckGo, Bing etc.) read it and provide optimization. It means according to meta information search engine shows our website on top most during the search.

There are some meta tags which are by default available in boilerplate and some are added according to our desire.

By default meta tags are shown below. Here charset="UTF-8" is a standard which supports our content like characters in our webpage. The second line http-equiv="X-UA-Compatible" content="IE=edge" means It supports the internet explorer browser. And the third line name="viewport" content="width=device-width, initial-scale=1.0" means It supports all screen sizes. It means our web page will load perfectly on any screen size like mobile, tablet, laptop, desktop etc.

<meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

When we use Meta Tag? The meta tag is used when we want to provide information about our website for SEO (search engine optimization) purposes, like author, key, description, viewport, charset etc. There are Some examples of meta tags shown below.

 <meta name="description" content="these are articles for web developers" />
    <meta name="keyword" content="HTML, CSS, JS, DBMS, SQL" />
    <meta http-equiv="refresh" content="5" />
    <meta name="author" content="GUDIYA KUMARI" />

Note: We can add a URL of another page/website which we want after refreshing using the meta tag.

<meta http-equiv = " refresh " content = " 5; url = https://www.google.com " />

If we add this meta tag to our web page then in every 5 sec our page will refresh and will go to the given URL (google.com).