HTML Meta


What is HTML meta?

HTML meta is an HTML tag that provides metadata about an HTML document. Metadata is data about data, and it provides information about the HTML document that isn’t visible to the user. Metadata includes things like the title of the document, keywords, descriptions, and authorship.

Why is HTML metadata important?

HTML meta is important because it helps search engines and social media platforms understand what your web page is about. By including metadata in your HTML document, you can provide important information that search engines can use to rank your website in search results. Metadata also helps social media platforms display a preview of your website when it is shared.


How to use HTML meta

To use Meta, you need to add meta tags to the head section of your HTML document. Here’s an example of how to add meta tags for the title, description, keywords, and author:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="This is the description of my website.">
<meta name="keywords" content="keyword1, keyword2, keyword3">
<meta name="author" content="Your Name">
<title>My Website Title</title>
</head>
<body>
<!-- Your website content goes here -->
</body>
</html>

Let’s break down each meta tag:

  1. Charset: Specifies the character encoding for the HTML document. This should be set to UTF-8, which is the standard encoding for web documents.
<meta charset="UTF-8">
  1. Viewport: Specifies the viewport settings for the website, which determines how the website is displayed on different devices. The width=device-width setting makes the website scale to the width of the device.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
  1. Description: Provides a brief description of the website, which is displayed in search engine results.
<meta name="description" content="This is the description of my website.">
  1. Keywords: Specifies the keywords associated with the website, which are used by search engines to index the website.
<meta name="keywords" content="keyword1, keyword2, keyword3">
  1. Author: Specifies the author of the website.
<meta name="author" content="Your Name">
  1. Title: Specifies the title of the website, which is displayed in the browser tab and search engine results.
<title>My Website Title</title>

HTML meta is an important part of web development because it helps search engines and social media platforms understand what your website is about. By including metadata in your HTML document, you can improve your website’s visibility and make it easier for users to find. Remember to include meta tags for the title, description, keywords, and author in the head section of your HTML document.