Friday, July 26, 2024

HTML Meta Tags

HTML meta tags provide metadata about a webpage, which is essential for search engines and browsers. They are placed within the <head> section and include information such as character encoding, page description, keywords, and viewport settings. Meta tags do not display content on the page but help with SEO, responsive design, and document structure. Common meta tags include charset, description, and viewport.

Examples:

<meta charset="UTF-8">

<meta name="description" content="This is a brief description of the webpage.">

<meta name="keywords" content="HTML, CSS, JavaScript, web development">

<meta name="author" content="Your Name">

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


HTML Code:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML Tutorial</title>
</head>
<body>
    <h1>HTML Meta Tags</h1>
    <p>Meta tags provide metadata about the HTML document. They are placed inside the <code>&lt;head&gt;</code> section.</p>
        <meta charset="UTF-8">
<meta name="description" content="This is a brief description of the webpage.">
<meta name="keywords" content="HTML, CSS, JavaScript, web development">
<meta name="author" content="Your Name">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <pre>
        &lt;meta name="description" content="A brief description of the page"&gt;
        &lt;meta name="keywords" content="HTML, tutorial, meta tags"&gt;
        &lt;meta name="author" content="Your Name"&gt;
        &lt;meta charset="UTF-8"&gt;
    </pre>
<body>
</html>

The Output of the above code:


HTML Tutorial

HTML Meta Tags

Meta tags provide metadata about the HTML document. They are placed inside the <head> section.

        <meta name="description" content="A brief description of the page">
        <meta name="keywords" content="HTML, tutorial, meta tags">
        <meta name="author" content="Your Name">
        <meta charset="UTF-8">