Wednesday, 2 Jul 2025
  • My Feed
  • My Interests
  • My Saves
  • History
  • Blog
Subscribe
Code Reveals
  • Home
  • HTML

    What are the different types of HTML tags?

    By Chief Editor
    What is Symentic HTML

    What is Symentic HTML?

    By Chief Editor

    What is the difference between “HTML” and “HTML5”?

    By Chief Editor

    What is a Meta Tag in HTML?

    By Chief Editor

    What are the async and defer attributes in the “script” tag?

    By Chief Editor

    What is Block level Element and Inline Level Element?

    By Chief Editor
  • JavaScript

    Explain Deep Copy and Shallow Copy in JavaScript.

    By Chief Editor

    What is Scope in JavaScript?

    By Chief Editor

    What is memoization in JavaScript?

    By Chief Editor

    Is JavaScript a synchronous or asynchronous language?

    By Chief Editor

    How to Reverse a String in JavaScript: Two Essential Methods

    By Chief Editor

    What is Arrow and Normal Function in JavaScript?

    By Chief Editor
  • Frontend Interview

    What is Symentic HTML?

    By Chief Editor

    What is Block level Element and Inline Level Element?

    By Chief Editor

    What are the Lexical Scope in JavaScript?

    By Chief Editor

    Difference Between position: relative and position: absolute in CSS

    By Chief Editor

    What is Position in CSS?

    By Chief Editor

    Is JavaScript a synchronous or asynchronous language?

    By Chief Editor
  • Backend Interview

    What is a Closure in JavaScript?

    By Chief Editor

    What is memoization in JavaScript?

    By Chief Editor

    What is a Function Component in React?

    By Chief Editor

    Is JavaScript a synchronous or asynchronous language?

    By Chief Editor

    How Can You Share Data Between Components in React?

    By Chief Editor

    What is Flex Box in CSS?

    By Chief Editor
  • Other
    • Contact Us
  • Frontend Interview
  • Backend Interview
  • React Interview
  • JavaScript Interview
  • Contacts Us
  • Advertise with Us
  • Complaint
  • Privacy Policy
  • Cookie Policy
  • Submit a Tip
  • 🔥
  • ReactJS
  • JavaScript
  • JavaScript Interview
  • React Interview
  • HTML
  • Frontend Interview
  • CSS
  • Redux
  • Javascript
  • System Design
Font ResizerAa
Code RevealsCode Reveals
  • My Saves
  • My Interests
  • My Feed
  • History
  • Technology
Search
  • Homepage
  • Pages
    • Home
    • Blog Index
    • Contact Us
    • Search Page
    • 404 Page
  • Features
    • Post Headers
    • Layout
  • Personalized
    • My Feed
    • My Saves
    • My Interests
    • History
  • About
  • Categories
    • Technology
  • Categories
Have an existing account? Sign In
Follow US
© 2022 Code Reveals Inc. All Rights Reserved.

Home What is a Meta Tag in HTML?

HTML

What is a Meta Tag in HTML?

Chief Editor
Last updated: May 5, 2025 12:09 pm
Chief Editor
Share
SHARE

A meta tag in HTML is an element that provides metadata (information) about a web page.
Meta tags do not display content on the page; instead, they provide information to browsers, search engines, and other services.

Contents
Why Meta Tags Are Important:Commonly Used Meta Tags and PropertiesDetailed Examples:Complete Example:Key Takeaways:

They are placed inside the <head> section of an HTML document.

Syntax:

<meta name="name" content="value">

Why Meta Tags Are Important:

  • Help search engines understand the page content (SEO).
  • Define the character set of the document.
  • Control viewport settings for responsive design.
  • Specify page descriptions, keywords, author, and more.

Commonly Used Meta Tags and Properties

Meta TagDescriptionExample
CharsetSpecifies the character encoding.<meta charset="UTF-8">
ViewportControls layout and scaling on mobile devices.<meta name="viewport" content="width=device-width, initial-scale=1.0">
DescriptionShort description of the page (SEO).<meta name="description" content="Learn HTML and web development.">
KeywordsList of keywords (less relevant today for SEO).<meta name="keywords" content="HTML, CSS, Web Development">
AuthorSpecifies the author of the document.<meta name="author" content="John Doe">
RobotsInstructs search engines on indexing and following links.<meta name="robots" content="index, follow">
Refresh/RedirectAutomatically refreshes the page after a certain time or redirects.<meta http-equiv="refresh" content="5; url=https://example.com">
Open Graph (Facebook Sharing)Controls how the page appears when shared on social media.<meta property="og:title" content="Learn HTML">
Twitter CardsEnhances the appearance of the page on Twitter.<meta name="twitter:card" content="summary_large_image">

Detailed Examples:

1. Charset Example:

<meta charset="UTF-8">

Ensures proper encoding for special characters like é, ü, ñ.


2. Viewport Example (Responsive Design):

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

Ensures the page adapts to different screen sizes (important for mobile devices).


3. Description Example (SEO):

<meta name="description" content="This is a comprehensive guide to HTML for beginners.">

Used by search engines as a summary of the page.


4. Keywords Example (Less Relevant Today):

<meta name="keywords" content="HTML, CSS, JavaScript, Web Development">

Not heavily used by search engines anymore but can still be useful in some cases.


5. Author Example:

<meta name="author" content="Jane Doe">

Specifies the author of the page.


6. Robots Example:

<meta name="robots" content="noindex, nofollow">

Tells search engines not to index the page or follow any links on it.

ValueMeaning
indexIndex the page
noindexDon’t index the page
followFollow links on the page
nofollowDon’t follow any links on the page

7. Refresh/Redirect Example:

<meta http-equiv="refresh" content="10;url=https://example.com">

Redirects to https://example.com after 10 seconds.


8. Open Graph (for Facebook Sharing):

<meta property="og:title" content="Learn HTML Fast">
<meta property="og:description" content="A quick and easy guide to HTML.">
<meta property="og:image" content="https://example.com/html-guide.png">
<meta property="og:url" content="https://example.com/html-guide">

Defines how the page appears when shared on Facebook.


9. Twitter Cards:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Learn HTML Fast">
<meta name="twitter:description" content="Quick and easy HTML guide for beginners.">
<meta name="twitter:image" content="https://example.com/html-guide.png">

Enhances page appearance on Twitter.


Complete Example:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Learn HTML from scratch with this beginner-friendly guide.">
<meta name="keywords" content="HTML, Web Development, Coding">
<meta name="author" content="John Doe">
<meta name="robots" content="index, follow">
<title>Learn HTML - Beginner's Guide</title>
</head>
<body>
<h1>Welcome to HTML Guide</h1>
</body>
</html>

Key Takeaways:

  • Meta tags provide information about a webpage to browsers, search engines, and social media platforms.
  • Important for SEO, social media previews, and responsive design.
  • Placed within the <head> section of an HTML document.

Let me know if you need more details or help with anything else! 😊

Share This Article
Email Copy Link Print
Previous Article Difference between HTML Tag and HTML Element in HTML?
Next Article What is Doctype HTML in HTML?
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Trusted Source for Accurate and Timely Updates!

Our commitment to accuracy, impartiality, and delivering breaking news as it happens has earned us the trust of a vast audience. Stay ahead with real-time updates on the latest events, trends.
FacebookLike
XFollow
InstagramFollow
YoutubeSubscribe
LinkedInFollow
QuoraFollow
- Advertisement -
Ad imageAd image

Popular Posts

What is props drilling in React?

Props Drilling is a situation in React where data (props) needs to be passed through…

By Chief Editor

What is React Router Dom in React?

React Router DOM is a popular library in React that is used to handle navigation…

By Chief Editor

What is the difference between “HTML” and “HTML5”?

Difference Between HTML and HTML5 HTML (HyperText Markup Language) is the standard language used to…

By Chief Editor

You Might Also Like

HTML

What are the async and defer attributes in the “script” tag?

By Chief Editor
What is Symentic HTML
Frontend InterviewHTML

What is Symentic HTML?

By Chief Editor
HTML

What is Doctype HTML in HTML?

By Chief Editor
Frontend InterviewHTML

What is Block level Element and Inline Level Element?

By Chief Editor

Code Reveals is a cutting-edge software development company dedicated to delivering high-quality, scalable, and innovative solutions for businesses of all sizes. Our team of expert developers, designers, and engineers specializes in creating custom software, web applications, mobile apps, and enterprise solutions that are tailored to meet the unique needs of our clients.

Most Famous
  • HTML
  • CSS
  • JavaScript
  • Node
Top Categories
  • Frontend Interview
  • Backend Interview
  • React Interview
  • JavaScript Interview
Usefull Links
  • Contacts Us
  • Advertise with Us
  • Complaint
  • Privacy Policy
  • Cookie Policy
  • Submit a Tip

©2025  Code Reveals Inc. All Rights Reserved.

Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?