Search code examples
htmlwebmeta

Meaning and usage of meta tags


I have some questions about meta tags.

  1. At the top of a tab, where the title shows up, there's an image next to it. How do I add an image like that?

  2. The <meta name="keywords" content="HTML, Questions," meta tag, does it still have any purpose?

  3. Why is <meta name="author" content="Firstname Lastname" Used? What purpose does it serve?

  4. How do you use <meta viewport>?


Solution

  • In the past, meta tags were used by search engines to index web pages based on title, description, and even keywords. However, certain websites started overusing them, cramming popular keywords in the hope of getting better search results. Google, recognizing this, announced that they don’t use meta keywords or descriptions in their search algorithms for ranking purposes. Coming onto one attribute at a time:

    1) Description- Search engines generates a description from the content attribute. When you share URL of your webpage to other websites or platforms, let's say you share a blog on Whatsapp, Whatsapp will show the description along with your URL to the users. You can try it on your own.

    2) charset="UTF-8" - sets the encoding of your webpage. Another encoding is UTF-16.

    3) Keywords- Keywords help other applications to know more about your website. Although many websites still use the keywords value of the name attribute, Google doesn't consider this in its search ranking algorithm or when displaying search results.

    4) Author- You can set the author of a page using author attribute.

    5) - Before tablets and mobile phones, web pages were designed only for computer screens, and it was common for web pages to have a static design and a fixed size. Then, when we started surfing the internet using tablets and mobile phones, fixed size web pages were too large to fit the viewport. To fix this, browsers on those devices scaled down the entire web page to fit the screen.

    Meta tags can be used to perform the task of HTTP headers like redirection and refresh also.

    To know more about meta tags you can refer to this link https://www.sitepoint.com/meta-tags-html-basics-best-practices/