Learn one of the most powerful programming languages in the world and become a rockstar developer.
The <head>
element is a container for metadata (data about data) and is placed between the <html>
tag and the <body>
tag.
HTML metadata is data about the HTML document. Metadata is not displayed.
Metadata typically define the document title, character set, styles, scripts, and other meta information.
The following tags describe metadata: <title>
, <style>
, <meta>
, <link>
, <script>
, and <base>
.
The <title>
element defines the title of the document, and is required in all HTML documents.
The <title>
element:
A simple HTML document:
<!DOCTYPE html> <html lang="en"> <head> <title>Hello World Document</title> </head> <body> <p>Hello World!</p> </body> </html>
The <style>
element is used to define style information for a single HTML page:
<head> <title>Internal style sheet</title> <style> body { background-color: YellowGreen; } h1 { color: red; } p { color: green; } </style> </head>
The <link>
element is used to link to external style sheets:
<link rel="stylesheet" href="mystyle.css">
The <meta>
element provides metadata about the HTML document. Metadata is a set of data that describes and gives information about other data.
The <script>
element is used to define a client-side script, such as a JavaScript.
The script and noscript element will be explained in a later chapter.