0% completed
In this lesson, you'll learn what meta tags are, why they're important, and how they can enhance your webpage’s performance in search engines and improve user experience. Meta tags play a crucial role in providing information to browsers and other systems without directly affecting the visible content of your page.
Meta tags are snippets of text placed in the <head>
section of an HTML document. They give metadata (data about data) regarding your webpage to browsers, search engines, and other services. This metadata can influence how your page is indexed, displayed, and interpreted by different platforms.
Meta tags are defined with the <meta>
element and typically include attributes such as name
, content
, and sometimes http-equiv
. They are self-closing tags, meaning they do not require a closing tag.
Syntax Example:
<head> <meta name="description" content="A brief description of the webpage"> </head>
name="description"
: Indicates the type of meta information (in this case, a description).content="..."
: The value of that meta information.Defines how characters are interpreted, ensuring your webpage displays text correctly (especially important for non-English languages).
<meta charset="UTF-8">
UTF-8
is the most commonly used character encoding, supporting a wide range of characters and symbols.Provides a brief summary of your webpage content. Search engines often display this text in search results.
<meta name="description" content="Learn the fundamentals of HTML meta tags and how they affect SEO.">
Indicates the author of the webpage’s content.
<meta name="author" content="John Doe">
Controls how your webpage is displayed on mobile devices. This meta tag is essential for responsive design.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
width=device-width
: Sets the page width to the device’s screen size.initial-scale=1.0
: Defines the initial zoom level.Below is a simple HTML page demonstrating the use of meta tags in the <head>
section.
Explanation:
<meta charset="UTF-8">
ensures proper display of characters.<meta name="description">
influences search engine snippets.Using meta tags effectively can enhance both the user experience and your site’s visibility in search results. In the next lesson, we’ll explore HTML Favicons, another small but important aspect of your site's identity.
.....
.....
.....