World Wide Web Media and the Hypertext Markup Language (HTML)
(Page 2 of 4)
HTML Elements and Tags
In simplest terms, an HTML document is a plain ASCII text file like an e-mail message or other text document. The biggest difference between HTML and regular text, however, is that HTML documents are structured. The document is logically organized into a series of elements that are arranged according to the rules of the language. Each element defines one part of the document as a whole. For example, the title of a document, a paragraph, a table and a hyperlink to another document are all examples of elements.
Each element is described using special text tags that follow a particular syntax. Each tag begins with the < symbol, which is then followed by the (case-insensitive) element name, and optionally, additional parameters that describe the element. The tag ends with the > symbol. Here's how a tag looks generally:
<element parameter1=value1 parameter2=value2 >
Some elements are entirely described by the presence of a tag, and in such cases that tag is the entire element. More often, tags occur in pairs surrounding the actual content of the element; the start tag begins with the name of the element and the end tag begins with the name of the element preceded by a slash symbol. For example, the title of a document is an element defined as follows:
<title>This Is A Great Story</title>
The content of each element can contain other elements, which causes tags to be nested within each other. For example, if we wanted to highlight the word Great in our title by displaying it in bold letters, we can add the <b> tag as follows:
<title>This Is A <b>Great</b> Story</title>
Each whole HTML document is in fact defined as a single element called html; the whole document is enclosed in <html> and </html> tags. Within this element, the document is divided into two standard sub-elements that must be present in each document: the head and the body. The head of the document contains information that describes the document and how it is to be processed; it most commonly contains the title of the document as described above. The body contains the actual content of the document. These three elements define the basic HTML document structure:
The bulk of the document consists of the body elements that are placed between the <body> and </body> tags. HTML documents can range from very simple bodies containing only elements such as text paragraphs and perhaps a few links, to very sophisticated documents that are computer-generated and contain hundreds or even thousands of nested tags of various sorts.
Home - Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.