HTML Head Elements
<meta> Tag
The <meta> tag provides metadata about the webpage. It's not displayed but helps browsers and search engines understand the content.
Common Uses:
<meta charset="UTF-8"> <!-- Defines character encoding -->
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Responsive scaling -->
<meta name="description" content="Learn HTML head elements."> <!-- SEO description -->
<meta name="author" content="Your Name"> <!-- Author information -->
class="section-title"><title> Tag
The <title> tag sets the page title shown in the browser tab and used in bookmarks and search engine results.
<title>My First Web Page</title>
<link> Tag
The <link> tag connects external resources like stylesheets or icons.
Examples:
<link rel="stylesheet" href="style.css"> <!-- External CSS -->
<link rel="icon" href="favicon.ico" type="image/x-icon"> <!-- Favicon -->
class="section-title"> <script> Tag
The <script> tag is used to include JavaScript in your webpage.
Examples:
<script src="script.js"></script> <!-- External script -->
<script>
console.log("Inline JavaScript");
</script> <!-- Inline script -->
class="section-title">Summary
Tag | Purpose |
---|---|
<meta> | Metadata (SEO, encoding, viewport) |
<title> | Page title |
<link> | External resources (CSS, icons) |
<script> | JavaScript integration |