Structure of an HTML Document
While considering the structure of a well defined HTML document, there are two basic segments into which a HTML document is divided into. The first one is the head and the body. Before the head, every structure of an HTML document starts with the basic declaration of the document type. DOCTYPE is the description which specifies the version of the markup language in which the webpage is written and this is meant for the browser to display the information properly. Various versions are XHTML 1.0 strict, XHTML 1.0 transitional, XHTML 1.0 frameset and XHTML 1.1.
E.g.:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http:/
/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
Everything in HTML is written between the html tags, which is the container for the whole document. The attributes for these tags are the lang which describes the language and the xmlns which is necessary for HTML and XHTML as well.
e.g. <html lang=”en” dir=”ltr” xmlns=”http://www.w3.org/1999/xhtml”>
Before any content is written in an HTML code, characteristics of the code are specified in the head section. The tags which are included in this section are the document’s title, style declarations, script functions and meta statements.
<head>
<title>Google</title>
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″>
<script type=”text/javascript” src=”https://s-static.facebook.com/bQ.js”></script>
<style>table {border-width: 100%;border-color: black;}</style>
</head>
After the description about the non-visual information is complete, the body which contains the information about the visual content is written. All the main content is written in this section. This structure of an HTML document is followed for a well written HTML code and a well formed webpage.
<body>
…
…
</body>
After everything is complete in all respects, all the tags are closed in the reverse order of their opening. This structure used for an HTML document is also applicable for an XHTML document as well, with the fact that the structure shown here is to be strictly taken into consideration.
Recent Topics
- Working with Images in HTML Documents
- Webpage Forms in HTML
- Web Safe Colors in HTML
- Use Ordered Lists in a Webpage
- Top Graphic Editing Software in Webpage Design
- Tables and Frames in HTML
- Structure of an HTML Document
- Setup Cascade Style Sheets (CSS) in HTML files
- HTML and XHTML in Webpage Creation
- HTML and Meta Tags for Search Engine Optimization
- How to Validate HTML File
- How to Use Hexadecimal Color Codes in HTML
- How to Create Website Banners
- Formatted Lists in HTML Document
- Embedding HTML in PHP





