HTML Meta Tags

 

HTML Meta Tags









The <meta> tags in HTML provide metadata about the HTML document. Metadata is data (information) about data. <meta> tags always go inside the document's <head> tag and are typically used to specify the character set, page description, keywords, author, and other metadata.
Below is an example HTML code snippet that includes various types of <meta> tags commonly used:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"> <!-- Character encoding -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Responsive design -->
    <meta http-equiv="X-UA-Compatible" content="ie=edge"> <!-- Internet Explorer compatibility -->
    <meta name="description" content="This is a description of the web page"> <!-- Description for search engines -->
    <meta name="keywords" content="HTML, CSS, JavaScript"> <!-- Keywords for search engines -->
    <meta name="author" content="Your Name"> <!-- Author name -->
    <title>Document</title>
</head>
<body>
    <!-- Your content here -->
</body>
</html>

Explanation of each meta tag:

  1. Character Encoding (charset)<meta charset="UTF-8"> sets the character encoding for the webpage. UTF-8 is the most common and recommended.

  2. Viewport<meta name="viewport" content="width=device-width, initial-scale=1.0"> sets the viewport to scale the page to the screen width, useful for responsive design.

  3. IE Compatibility<meta http-equiv="X-UA-Compatible" content="ie=edge"> specifies that the page should be rendered using the latest rendering engine available on Internet Explorer.

  4. Description<meta name="description" content="This is a description of the web page"> provides a brief description of the webpage, which search engines may use in search results.

  5. Keywords<meta name="keywords" content="HTML, CSS, JavaScript"> specifies keywords for the webpage, which were historically used by search engines but are less relevant today.

  6. Author<meta name="author" content="Your Name"> indicates the name of the author of the webpage.




Related Posts:

  • HTML Text Formatting HTML formatting involves enhancing the visual presentation of text. It enables text manipulation for improved aesthetics, eliminating the n… Read More
  • figure tag The figure element is particularly useful for images, illustrations, diagrams, videos, audio clips, and other types of media.Use the alt attribu… Read More
  • HTML Id & Classes IDs and Classes in HTMLWhat is an ID?An ID is an attribute, a unique identifier assigned to only one HTML element within a page.It is often used… Read More
  • HTML Tags What is an HTML Tag?HTML Tags are the basic building block of elements in HTML. tags start with open (< ) and closing  ( … Read More
  • PICTURE TAG The <picture> element in HTML is used to provide multiple sources of an image, allowing the   browser to choose the most appropr… Read More

0 Comments:

Post a Comment

Do leave your comments