Course Content
HTML Introduction
0/1
HTML Editors
0/1
HTML Basic Tags
0/1
HTML Elements
0/1
HTML Attributes
0/1
HTML Headings
0/1
HTML Paragraph
0/1
HTML Text Formatting
0/1
HTML Meta Tags
0/1
HTML Quotations
0/1
HTML Comments
0/1
HTML Images
0/1
HTML Background
0/1
HTML Colors
0/1
HTML Lists
0/1
HTML Tables
0/1
HTML Forms
0/1
HTML Spell Check
0/1
HTML Media
0/1
HTML Marquees
0/1
HTML CSS
0/1
HTML Links
0/1
HTML Block & Inline
0/1
HTML Classes
0/1
HTML Id
0/1
HTML I frames
0/1
HTML Java script
0/1
HTML File paths
0/1
HTML Layout
0/1
HTML Responsive
0/1
HTML Computer Code
0/1
HTML Tutorial
About Lesson

HTML Meta Tag

In this tutorial, we will learn about meta tag in HTML with the help of examples.


<meta> Tag

The <meta> Element is used to define metadata about an HTML document. It provides important information about a document.
A web document can include one or more <meta> tag but in general, meta tags don’t affect the physical appearance of the document. It carries information within its attributes.

Things to Remember :

  • The <meta> tag always go inside the <head> element.
  • <meta> tag is an empty element because it only has an opening tag.
  • Metadata is used by browsers, search engines, and other web services.
  • Add a meta tag to HTML Document – add metadata in HTML document using meta tag inside the head tag.

Attributes used in <meta> Tag

Attributes Value Description
Name name, author, description, keywords, viewport Used to define the name of the metadata
charset character_set specify the character encoding for the HTML document
http-equiv content-security-policy, content-type, default-style, refresh specify the HTTP responsive header
content text specify the properties value

Meta Tag Basic Attributes

  • keywords – Define important keywords for search engines
  • character_set – Define the character encoding for the HTML document
  • Description – Define short description about the document for search engines
  • Refresh – Specify a duration after which your webpage will refresh automatically
  • Viewport – Setting the viewport to make website look good on all devices
  • Author name – Setting author name in a webpage

Example :

<!DOCTYPE html>
<html>
  <head>
    <title>HTML meta tag</title>
    <meta name = "keywords" content = "HTML, CSS, JS">
    <meta character_set = "UTF-8">
    <meta name = "description" content = "Learn HTML, C language
and C++ Language for free"
>

    <meta http-equiv = "refresh" content = "15s">
    <meta name = "viewport" content = "width = device-width,
initial-scale = 1.0"
>

    <meta name = "author" content = "xyz">
  </head>
  <body>
    Here, we use meta tags.
  </body>
</html>

Output

Here, we use meta tags.

 

Exercise Files
No Attachment Found
No Attachment Found
error: Content is protected !!