Trying to understand the head tag in html

تبليغ
سؤال

يرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.

تبليغ
‎إلغاء

I am new to HTML and started with my first lesson.
I am unable to understand the head tag clearly and need help to understand it clearly.

As I read about the head tag, it says “The head of an HTML document is the part that is not displayed in the web browser when the page is loaded.”

However when I try in my lab exercise with the below code in my html file, the content inside the h1 tag that is within the head tag is displayed in the web browser, which is confusing me as I was expecting that, whatever I write inside the head tag will not be displayed in the browser, as per what I read. Can someone give me clarity on this.

<!DOCTYPE html>
<html>
<head>
<title>First Lesson</title>
<h1>Hello World!</h1>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>

‫أضف إجابة

تصفح
تصفح

مجهول يجيب