What is the Header?
Introduction to the <head> Tag
<head> TagThe <head> tag is a section of an HTML document that contains metadata and links to resources. It does not display content directly on the webpage but plays a crucial role in providing information and functionality.
Common Elements Inside the <head> Tag
<head> TagList of Key Elements:
<title>: Sets the title of the webpage, shown in the browser tab and search engine results.<meta>: Provides metadata such as the character set (<meta charset="UTF-8">), viewport settings for responsive design, and description for search engines.<link>: Links to external resources like CSS stylesheets and JS files.<style>: Contains internal CSS styles.<script>: Includes or links to JavaScript files.<noscript>: Provides alternative content for users with JavaScript disabled.
Example of a typical
<head>section:<head> <title>My Web Page</title> <meta charset="UTF-8"> <meta name="description" content="A brief description of my webpage"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> <style> /* This is where you would put page specific CSS. */ body{ text-align: center; } </style> <script src="script.js"></script> </head>
Explanation of Important Element
<meta>
<link>
<style>
<script>
The Role of Metadata
Metadata and SEO:
<meta>tags like description, keywords, and author, impact search engine optimization and the page's visibility in search results.
More info about Metadata can be found in the META tab, including information about how to make your website have a discord embed.
Sample Document Layout:
Last updated
Was this helpful?