Table of Contents
List of Meta tag in HTML
Working of Meta tag in HTML
Examples on Meta Tag in HTML
Example #3
Conclusion
Home Web Front-end HTML Tutorial Meta Tag in HTML

Meta Tag in HTML

Sep 04, 2024 pm 04:20 PM
html html5 HTML Tutorial HTML Properties HTML tags

A meta tag in HTML is used to define data about your webpage or HTML document. With the help of a meta tag, one can define the description of the document, its author information when it was last updated; it uses to give detailed properties of the HTML document. Meta tag is defined within the HTML tag, which included in part. It is most useful to the web designers to show the actual display part of the web page. The whole viewport control will be done by them using meta tags in HTML 5. The meta tag is referred to by most of the browsers for many useful features like refreshing pages, displaying web pages content, and web services used by them.

Syntax

Meta tag used in the head section as follows:

<meta charset="utf-8">
Copy after login

In the above syntax, it states that charset=”utf-8” provides the best support for displaying any kind of language.
Here is another syntax for meta tag with some value is:

<meta name="viewport" content="width=device-width, initial-scale=1.0">
Copy after login

It is used to handle the size of the viewport with all its page dimension value and page scrolling to fit our webpage perfectly on any kind of device.

List of Meta tag in HTML

There are different types of Meta tags used in HTML; let’s see one by one:

1. This is a very basic meta tag used to define any kind of language.

2.  It is used to define your content’s description up to 150 words.

3.  It is used to preserve all copyrights of defined company.

4.  It is used to define abstract of specific webpage.

5.  It is used to define author of your HTML document.

6.  It is used to define URL address of specific company defined in tag attribute.

7.  It is used to handle ratings which comes on our document.

8.  If we want to define subtitle for our HTML documents then it made possible using this tag.

9.  It is used to refresh our webpage at its defined time spam.

10.  It is used to classify our document at defined entity value.

11.  This tag is used to specify some keywords in Meta tag, so it’s made possible to search this content easily in our document.

12.  This tag is used to define summary of our document.

Working of Meta tag in HTML

Meta tag in HTML is mainly used to include machine-readable information in our webpage document, which is actually invisible on the webpage. Another most important work of this tag in HTML is, with the help of this tag, one can easily redirect to the other webpage using this meta tag feature.

There is some attributes list on which meta tag works finely are as follows:

1. Content: Content in the meta tag works like value for its included meta tag.

2. Name: Name works as property for meta tag. It comes in the form of details, owner, keywords, etc.

3. http-equiv: This attribute used to define header details in the document.

4. Charset: It is the main attribute in the Meta tag used to define character encoding for declaration purposes in its document.

5. Scheme: this attribute is used to define the scheme in which the actual meta tag is going to be used. But this type of attribute is not supported in HTML5.

Examples on Meta Tag in HTML

Let’s see some examples

Example #1

We are going to use the Meta tag, and it will read by the computer system but not able to see anything to the visitors of the webpage.

HTML code:

<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="Meta tag details information here">
<meta name="robots" content="Robotics"/>
<meta name="hotmail:card" content="summary"/>
</head>
</html>
Copy after login

Output: It will show a blank screen as an output.

Meta Tag in HTML

Example #2

Here is this example we are going to use different kinds of Meta tags and show the output; the web page will be refresh at every specific time and store cookies for your page, also mentioning its expiry date.

HTML code:

<html>
<head>
<title>Meta Tags Example</title>
<meta name = "keywords" content = "HTML, Meta Tags, Metadata" />
<meta name = "description" content = "Learning about Meta Tags." />
<meta http-equiv = "cookie" content = "userid = xyz;
expires = Tuesday, 31-Dec-19 23:59:59 IST;" />
<meta name = "revised" content = "EDUCBA -Online courses, 3/7/2019" />
<meta http-equiv = "refresh" content = "5" />
</head>
<body>
<h1>EDUCBA</h1>
<h2>Become an Awesome Design Expert</h2>
<p>EDUCBA- All about online certification courses</p>
<h4>Learn Graphic designing, Animation, Game Development, Video Editing & more with our Online Certification Courses</h4>
<p>Choose your interest area and get certified with our online Courses in Finance, Data Science, Software Development, Excel, Design, Project Management, Personal Development, Marketing and Human Resources.</p>
</body>
</html>
Copy after login

Output: The webpage shown in output will refresh every 5 seconds.

Meta Tag in HTML

Example #3

Let’s see another example using meta tags, it will reflect the same as above, but after refreshing the webpage, it will redirect to another webpage which URL’s will be mentioned in the Meta tag as shown in the below HTML code:

HTML code:

<head>
<title>Meta Tags in HTML 5</title>
<meta name = "keywords" content = "HTML 5, Meta Tag" />
<meta name = "description" content = "Detail description of Meta Tags in
HTML 5."/>
<meta http-equiv = "refresh" content = "10; url = https://www.educba.com/" />
</head>
<body>
<p>EDUCBA- All about online certification courses</p>
</body>
Copy after login

Output:

Meta Tag in HTML

Meta Tag in HTML

Conclusion

So, a Meta tag in Html is used to define metadata about HTML documents. The code included in it is a machine-readable format that works well with a webpage but doesn’t show any content on the page to the visitors. Meta tag containing 3 different types of attributes like global, element-specific, and event handler attributes.

The above is the detailed content of Meta Tag in HTML. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

See all articles