B.3 HTML Tags


The nice part about the basic HTML is that it is easy to do. It is time-consuming and complicated, but it is not difficult. Everything you need is contained in the tags, which are the code identifying an HTML document and the various parts of its contents to a browser.

The tags all follow a set form ”start and stop:

  • Left angle bracket (<), tag name , right angle bracket (>) for start tag

  • Left angle bracket (<), slash (/), tag name, right angle bracket (>) for stop tag

These are usually paired in start/stop set (e.g., <H1> and </H1> ). These tags define various parts of the HTML document. Only a small set of tags is required; the others are advisable to make the document easier for the user to read.

B.3.1 Required Elements

<HTML>, </HTML>

Defines the HTML document

<HEAD>, </HEAD>

Defines the part of the document for the browsers use

<TITLE>, </TITLE>

Identifies the document to the Web

<BODY>, </BODY>

Defines the part of the document we see and use

Believe it or not, this is all that is required in an HTML document. The head and title part are required for use by the browser. Unless they peek behind the scene, users see only what is presented between the two body tags.

B.3.2 The Order of the Required Elements and Their Tags

<HTML>

<HEAD>

<TITLE> </TITLE>

</HEAD>

<BODY>

</BODY>

</HTML>

B.3.3 The Elements: What They Are and How They Are Used

<HTML>

This tag tells the browser the file contains HTML-coded information. The file extension .html identifies an HTML document. With DOS-based files use .htm ; Windows- and Mac-based files can use .htm or .html . Currently, UNIX files should use only .html .

<HTML> UPDATE!

There now are .shtml, .stm, .asp , and .xml Web pages, to name a few. UNIX servers undoubtedly recognize these also, but they are beyond the scope of this overview.

<HEAD>

This tag identifies first part of HTML-coded document. It contains the title. (This does not appear on the page itself.)

<TITLE>

This tag contains the document title. It is displayed on a browser window only and is not visible on the page itself. On the Web, it identifies a page subject to search engine criteria. It is used as a "hotlist," "favorites," or "bookmark" entry. It should be short, descriptive, and unique.

<HEAD> UPDATE!

Most Web page heads contain more than titles. The following are examples of what can be found there.

Metatags : make site topics known to (some) search engines

Style sheets/cascading style sheets (CSS) : define aspects of the body

Java scripts and JavaScript : add jazzy elements to the body of the document

<BODY>

This tag contains content of the document organized into various units:

Headings ( <H1> to <H6> )

Paragraphs <P>

Lists, which can be ordered <OL> or unordered <UL>

Preformatted text <PRE>

Addresses <ADDRESS>

Space dividers <BR>, <HR>

Graphic items

<BODY> UPDATE!

Preformatted text is rarely used unless you want something to look like a typed page. Tables replace preformatted text in most cases. The address portion is now often replaced by a reply form or e-mail address. Many of the interactive elements such as reply forms use CGI (Common Gateway Interface) scripts, usually written in Perl.



JavaScript by Example
JavaScript by Example (2nd Edition)
ISBN: 0137054890
EAN: 2147483647
Year: 2003
Pages: 150
Authors: Ellie Quigley

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net