Tuesday, 28 June, 2022

webmastertools4u

Webmaster Tools

single post

  • Home
  • HTML document structure
HTML

HTML document structure

About the main HTML document parts
 


 

HTML document consists of four major parts:

  1. HTML – All HTML documents begin with this tag that informs a browser about a document written using HTML language elements.

  2. Head – This tag indicates different technical information, e.g. the author of the document, program, and so on.

  3. Title – This is the name of a document. You will see this in your browser’s window.

  4. Body – This is the main part of HTML document which consists of HTML tags and text.

HTML language consists of tags that indicate to the browser how to picture text and other objects. All four document parts are put into HTML tags. A tag will always begin with a less than sign, like this: <. The tags will end with a greater than sign, like this: >. This is called an opening tag,  which begins the operation you wish to perform. A closing tag will always be the same as the opening tag, but will have a forward slash before the command, like this: </HTML>. Not all tags will require a closing tag. The simplest HTML document example would be like this:

<HTML>
<HEAD>
<TITLE>My first HTML document</TITLE>
</HEAD>
<BODY>
Hello World !
</BODY>
</HTML>

As you can see document begins with <HTML> tag and ends with </HTML> closing tag. Find opening and closing tags for all document parts – HEAD, TITLE and BODY.

Now save your first HTML page as mypage.html and open this file with your web browser. The result in your browser should be: Hello World!

All information is put between <BODY> and </BODY> tags. You can type the text using different formatting – spaces, tabulation, centering and so on. However, your browser will ignore this as it does only what HTML tags tell to. Lets put some more phrases to our example:

<HTML>
<HEAD>
<TITLE>My first HTML document</TITLE>
</HEAD>
<BODY>
Hello World !
That’s all.     Buy!
</BODY>
</HTML>

You probably expected to see the text as it is typed between BODY tags in your browser. However, the result is: Hello World ! That’s all. Buy!

All text is in one line. Well, lets go to the next tutorial and add a little life to our page. Let’s go to Basic HTML document elements.

Recent Comments

No comments to show.

Archives

Categories