head

G:hackHTMLmyHTML-Tutorial�5- head�1.png

Inside a webpage there are contents that point towards audience and some information that point toward the browser itself and search engines like Google.

For example inside the head element we can insert <meta> tag.

Search engines like Google scroll through websites and read each page of them. But they don’t have enough resource to read word by word of pages in the entire web. In order to save time and resource they use some factors to figure out what each page is all about.

One of the factors is reading the contents within the <head> element and looking for tags like <meta> tag.

A <meta> tag like <meta name=”description” content=”Free Web Tutorials”> or <meta name=”keywords” content=”HTML, CSS “> gives this idea to a search engine that this page is about web tutorial and to be more precise, HTML and CSS.

So we put tags like this within the <head> element of our source code to help search engines to realize what the page is all about as soon as possible.

Another tag we can put here within <head> is <title> element which declares the title of a page.

Example:

<!DOCTYPE html>
<html>
<head>
<title> Learning HTML is fun 🙂 </title>
</head>
<body >
</body>
</html>
G:hackHTMLmyHTML-Tutorial�5- headbandicam 2020-06-29 18-02-25-018.jpg

We put the <title> element within the <head> element, because browsers read html documents from top to bottom, and because we want to display the title of the page as soon as possible, we set the <title> to be in top section of the source code within the <head> element.