HTML elements consist of an opening tag and a closing tag, and the element is written between <> tags
For example:
<tag></tag>
We notice the presence of / in one of the two signs!
We put / in the closing tag, and the content of the element is written between the opening tag and the closing tag
For example
<tag>Hello world</tag>
note:
There are rare elements that do not need a close tag and are closed by placing / before the > sign
For example:
<tag />
An HTML page is not devoid of three main elements: html, head, and body, and we will discuss them in detail in this article.
Before we start this lesson called: HTML Syntax, we would like to welcome our dear visitors. Welcome and thank you for following us.
element html:
The <html> element is the root of the page, and this element contains all other html elements.
element head:
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.
body element:
The <body> element represents the content of an html document, such as titles, images, videos, texts, and other content that is visible to the user and invisible to the user as well.
What do you need to write the first html page?
- Creating an HTML page You need to learn how to create a page on the editor. To learn how to create an HTML page on the vscode editor, visit this article.
- An html page is not devoid of 3 very important elements, which are html, head and body
How to write an html page on the editor?
At the beginning, we write an opening tag of type html, then we close the element with a closing tag of the same type. After that, we write an element of type head inside the html element, then we lower the closing tag and write an element of type body.
For example:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
DOCTYPE html element:
element It allows the browser to recognize the version or standard of html or any markup language that is added to the document. It also prevents the browser from switching to evasive mode, that is, when doctype html is added to the page, it ensures that the browser will do its best to follow the relevant specifications.
Note:
There are many elements that are written in the head and body eras, which we will discuss in other lessons.
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 Mozilla developer website to understand the lesson well HTML element Head element Body element.
Thank you for reading the article and do not forget to share it with friends