The <head> Element
The <head> ... </head> element is the first area of the page after the <!Doctype html> declaration.
TInformation in the <head> section will not appear on the internet browser when previewed. Instead, it contains information for regarding the make up of the page. It may include scripts, information on stylesheets and metadata.
The following are some of the tags that may be foudn in the <head> section:
<title> ... </title>
<link>
<meta>
This provides metadata (information) about the HTML document such as:
<script>
<style>
TInformation in the <head> section will not appear on the internet browser when previewed. Instead, it contains information for regarding the make up of the page. It may include scripts, information on stylesheets and metadata.
The following are some of the tags that may be foudn in the <head> section:
<title> ... </title>
- This defines the title of the document / webpage
- provides a title when you save a webpage to your favourites / bookmarks
- Displays a page title in search engine results.
<link>
- This is used to specify the relationship betweent the HTML document / webpage and an external file.
- If you are using a CSS file to style your website, it must be linked to each webpage using the <link> tag.
<meta>
This provides metadata (information) about the HTML document such as:
- Page description
- Instructions for the web browser (eg. how to display content or reload page)
- Keywords (whcih can be used by search engines)
- Author of the document
<script>
- This is used to define a client-side script, such as a JavaScript.
- The <script> element either contains scripting statements, or it points to an external script file through the src attribute.
- Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.
<style>
- This is used to specify style information for the HTML document / webpage.
- Inside the <style> element, you will use CSS properties to specify how HTML elements should appear in a web browser.
- Any style applied in the <style> element will only be applied to the page in which it is saved.