What is head in HTML?
The head element is a place where files are placed on the document that are read automatically, such as the page title, JavaScript files, CSS files, and some other files.
Basic head elements:
meta Element:
What is meta element in HTML?
The meta element is one of the most important elements written on every HTML page. The meta element also has several attributes that play an important role in determining the type of meta element. We will try to cover two types of attributes namely charset and name.
note:
The meta element is one of the elements that does not need a closing tag and is closed with / before the > sign
For example:
<meta />
What is charset attribute in meta?
The charset attribute specifies the character encoding of an HTML document. The HTML 5 specification encourages web developers to use UTF-8, which covers almost all characters and symbols in the world.
Writing method:
<meta charset=”UTF-8″ />
What is name attribute in meta?
The value of the name attribute in the meta element determines the type of metadata, and the value of the content attribute defines metadata. There are many types, including:
<meta name=”description” content=”Page description” />
<meta name=”keywords” content=”Keywords” />
<meta name=”viewport”
content=”width=device-width, initial-scale=1.0″>
link Element:
What is link element in HTML?
note:
The link element is one of the elements that does not need a closing tag and is closed with / before the > sign
For example:
<link />
This element is used to create relationships between the current document and external sources. One of its most popular uses is linking the file you are working on to CSS files. You can also use it to create icons.
The link element has two attributes rel and href.
What is rel attribute in link?
The rel attribute on the link element is used to specify the type of the link element.
For example:
To link the document to an external CSS page, we use the stylesheet value, and if we want to include an image for the site, we use the icon value
What is href attribute in link?
The href attribute in the link element is used to specify the file we want to fetch something from, whether it’s an image, a link, or a CSS file.
How to use the link element in HTML?
<link rel=”Information type” href=”Path” />
style Element:
What is style element in HTML?
The style element is used to write CSS styles and these styles are applied to HTML elements on the same page.
Writing method:
<style>
CSS styles
</style>
title Element:
What is title element in HTML?
The title element specifies the title of the document that appears at the top of the page or tab of the page.
script Element:
What is script element in HTML?
The script element is used to include code. You can also use the script element with a language such as JavaScript and other languages.
We do not need to go into depth in explaining this element in the HTML course.
How to write an HTML page with these elements in the head?
<!DOCTYPE html
<html>
<head>
<meta charset="UTF-8" />
<meta name="description" content="Page description" />
<meta name="keywords" content="Keywords" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<link rel="icon" href="Path" />
<link rel="stylesheet " href="Path" />
<style></style>
<title>title page</title>
<script></script>
</head>
<body>
</body>
</html>
Are all the important elements in the head?
<!DOCTYPE html
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>title page</title>
</head>
<body>
</body>
</html>
Note: English is not my official language. Mostly I use Google Translate. So, if you encounter a problem or find some errors, you can report the error to me on the contact us page or comments, or go to the Mozilla developers website: meta tag, link tag, style tag, title tag, and script tag, to understand the lesson well.
Here we have finished. We will see you in the next lesson
Thank you for reading the article and do not forget to share it with friends