HTML Code Tutorial

HTML Codes Tutor Ebook Download

Doctype Tag

The doctype tag is the first tag on any HTML page. <!doctype>

It not actually an HTML tag , but rather an SGML (Standard Generalized Markup Language) declaration.

In the early days of the web it was used to tell a browser what version of HTML was used to build the page. Today it tells a browser what media, HTML, XHTML or other, the page is built with. It also tells a validator which version of media to use in checking the document's syntax.

If omitted the page will still work because the browser assumes a default value.

It is a good idea to include the tag, because browsers of the future could very well require it.

Example:
<!doctype html public "-//w3c//dtd HTML 4.0 Transitional//EN">
This is the recommended Doctype for beginners using basic HTML 4.
w3c - World Wide Web Consortium
dtd - Document Type Definitions
EN - English

Example 2:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

This declares the document to be HTML 4.01 Frameset. HTML 4 Frameset is a variant of HTML 4 Transitional for documents that use frames.

Some doctype declarations may cause your pages to malfunction in various browsers. Specifying a Strict rather than Transitional version of your media would mean that you have to be extra careful about not including errors or bad HTML in your code.

Example 3:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

This example specifies a strict version of XHTML 1.0. It also specifies a URL indicating where the media definition resides.
XHTML - Actually an advanced version of HTML that includes XML. It will eventually replace HTML. Requires lower case HTML coding, attributes be enclosed in quotations and use of all closing tags.

More Information

htmlhelp.com


Horizontal rule tag Anchor Tag

CGI Online
Website Design Tutorial
Main Website


This Free HTML Tutorial
is provided by Net Success 2000 Plus.
PO Box 1508
Somerset, KY 42502
Last Modified: September 30, 2007

HTML Codes Tutor Ebooks For Easy Website Design