codescracker


html

HTML Document Structure



« Previous Tutorial Next Tutorial »


HTML Document Structure

Here you will learn about document structure of an HTML document. The figure given below shows the general structure of an HTML document.

html document structure example

Texts between the BODY tag (<body> and </body>) will be displayed in or by the browser.

Basic Structure of an HTML Document

Here is an example shows the basic structure of an HTML document.

<!DOCTYPE html>
<html>
<head>
	<title>This is Page Title</title>
</head>
<body>

<h1>This is Main Heading</h1>
<p>This is a paragraph.</p>
	
</body>
</html>

To start HTML coding, open your text editor like Notepad for windows user. Type the above HTML code or just do copy and paste.

After typing/copying, save it as filename.htm or filename.html in you computer. Now open saved HTML document in a web browser to watch output webpage.

You will watch the following given HTML output webpage on your browser.

HTML Document Structure

Here is the explanation of the above HTML document structure example:

More Examples on HTML Document Structure

Here are some more HTML Examples showing the general structure of any HTML document.

<!DOCTYPE HTML>
<html>
<head>
	<title>HTML Document Structure Tutorial</title>
</head>
<body>

<h1>HTML Document Structure Tutorial</h1>
<p>This is HTML document structure tutorial.</p>
<h2>HTML Document Structure Example</h2>
<p>This is HTML document structure example.</p>

</body>
</html>

Here is the output produced by the above HTML code:

html structure

Here is another HTML example showing the basic structure of a HTML document:

<!DOCTYPE HTML>
<html>
<head>
	<title>HTML</title>
</head>
<body>

<h1>HTML</h1>
<p>HTML stands for Hyper Text Markup Language</p>
<h2>HTML Tutorial Link</h2>
<p><a href="/html/index.htm">HTML Tutorial</a></p>

</body>
</html>

Here is the output produced by the above HTML example:

basic structure of html document

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test