HTML head
Created By: chatGPT
The
<head>
element is a crucial part of any HTML document. It contains meta-information about the document that is not displayed directly on the web page. Information such as the title of the page, character set, linked stylesheets, and scripts can all be included in the <head>
. Here’s a breakdown of commonly used elements within the <head>
section:<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Page Title</title>
<link rel="stylesheet" href="styles.css">
<script src="script.js" defer></script>
</head>
Here's what each element does:
<meta charset="UTF-8">
// Specifies the character set for the HTML document.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
// Ensures the page is responsive on different devices.
<title>Your Page Title</title>
// Sets the title of the web page, displayed in the browser tab.
<link rel="stylesheet" href="styles.css">
// Links an external CSS file for styling the document.
<script src="script.js" defer></script>
// Links an external JavaScript file and defers execution until after the HTML is parsed.