Beginner's guide - Tags

  »   Beginner's guide  »   HTML Tutorial - Tags

Now that you have already created your web page, we should examine some segments of the "index.html" file. Certainly, you have seen that there is a model in the arrangement of the commands, some words are surrounded by "<" and ">", these are HTML tags.

An example of HTML tag is <body>. The <body> tag tells the browser, where the content of the web page begins.<body> is an example of tag who must exist in every web page.

Base tags in HTML

Let's take a look at the code. A web page has in composition two base elements. If you try to create a page without those two tags, you will have problems.

html<html>
	<body>
		Web's page content will go here
	</body>
</html>

the First tag is called <html> and is the tag that tells the browser that it had started an HTML code. The second tag, <body>, tells the browser that from there it had started the visible part or page content.

How to close a HTML tag

You may have observed already other two similar tags at the end of the document, </body> and </html>. These tag are for closing.</body>, lets the browser know that page's content is over, and </html> that the HTML document is done.

Slash "/" is situated before tag's name and it tells to the browser that he wants yo stop the current function. So <tag> is used to start a function, and </tag> to stop it.

Tag's order - very important

The order of opening and closing a tag is very important. If a tag is opened in another, for example, the body tag is opened inside HTML then that tag (body) is the one that needs to be closed before the parent tag (html).

We have closed the first body because it was the last one opened. This simple rule (opening and closing tag order) applies to all other HTML tags.

The second page

You may need time and more attempts so that you get used to these rules, so you should keep trying with the next web page. Copy this code in notepad, as you did with the first page.

html<html>
	<head>
		<title>My second web page ! </title>
	</head>
	
	<body>
		<h2>Welcome.</h2>
		<p>Very soon I will make a page which is going to be so cool!</p>
	</body>
</html>

After you have assured that everything is going along with the anterior indications, you can save the document. You could try to save it with the same name as the one before, "index.html". You may be asked if you want to overwrite the document, select OK, we won't need anymore the other document. When you are done, go on and read the next tutorial.