THE HEAD ELEMENT
Last updated January 11, 2023
The <head>
element is the element that stores metadata (data about data), and is placed before the <body>
, inside the <html>
element. Data inside is not displayed. Only certain elements should be put inside the <head>
:
<title>
<style>
<meta>
<base>
<link>
<script>
<noscript>
<!DOCTYPE html>
<html>
<head>
<title>Window title</title>
</head>
<body>
<h1> The head element </h1>
This window should be titled "Window title"!
</body>
</html>
OUTPUT:
Window Title = "Window title"
The head element
This page should be titled "Window title"!
This example uses the <title>
element to set the title of the window.
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: green;
}
</style>
</head>
<body>
<h1> The head element </h1>
This page exists.
</body>
</html>
OUTPUT:
The head element
This window should be titled "Window title"!
This example uses the <style>
element to make the heading green.