HTML - Elements: body, head, title

  »   HTML  »   HTML Tutorial - Elements: body, head, title

HTML elements have many ranks. All you see: paragraphs, banner, the navigation links from the left side and the right side , all are elements of this page.

An element has three parts: an opening tag, element's content, and closing.

  1. <p> - the tag that opens a paragraph
  2. Element's content - the paragraph itself.
  3. </p> - the closing tag.

***Note:
All the web pages will have at least the base elements: html, head, title and body.

<html> element

An HTML document will always begin with a <html> tag and will end with </html>. This is the standard structure of an HTML. Please open a Notepad and copy the next code:

html<html>
</html>

Save the document from the "File/Save As menu". Select All Files and name the new created file "index.html".Hit "Save". Now open the file in a browser so that you have the possibility to refresh the page (F5).

If you did everything well you will be able to see your web page white!

<head> element

The <head> element is the one that comes next. While you put it in between html and body everything should be just fine. "Head" has no visible function, so we will talk about this aspect in the next tutorials. Even though I want to mention that <head> can offer to the browser very useful information. You can introduce here other cods like JavaScript or CSS.

For the moment we will let this tag empty, and we will introduce the next element from the list, but first let us take a look without him:

html<html>
	<head> 
	</head> 
</html>

If you save the document and try to refresh the initial page from the browser you will not see any difference. Just have a little patience, because next, we will study some visible elements.

<title> element

So that everything goes well you must put the title tag inside the head tag. what you write between those two title tags ( <title> and </title>) will be seen as the browser's name, usually on the upper right side. Next, we have the source code:

html<html>
	<head>
		<title> My first web page!</title>
	</head>
</html>

Now save the file and open it in your browser. You will be able to see the title in the upper left or right side as in the majority of the browsers.

You can put any name you want, just remember that the descriptive names are the ones that are easier to find later.

<body> element

The body element is the one that defines the beginning of the page content itself (titles, paragraphs, photos, music, and any other content). As you can see in the menu from the left, we will talk about all elements one by one.

For now all you need to keep in mind is that body covers all the content of the page.

html<html>
	<head> 
		<title> My first web page!</title>
	</head>

	<body> 
		Hey guys! Here we will put the content later! 
	</body>

</html>

Now see what you have done, and after I invite you to see what is in the next section.