## Document type declaration

A valid HTML document has to include a document type declaration, which specifies which version of HTML is used in the document. There is usually no harm in leaving it out as browsers ignores this information, but other tools such as validators often require a document type declaration.

Alpha also uses the document type declaration to only let you use the HTML elements and attributes belonging to the HTML version specified. If a document contains a document type declaration then Alpha does the following.

- The menu items for those elements not in the HTML version specified are disabled.
- The attributes not in the HTML version specified are treated as if they belonged to the category Never ask about as discussed on the previous page.

Note. Alpha only understands the document type declarations for HTML 4.0 and ignores all other ones.

The specification for HTML 4.0 was released 18 December 1997 and is the current [April 98] official version of HTML. HTML 4.0 specifies three document type definitions (DTDs), which vary in the elements they support.

Strict
Includes all elements and attributes that have not been deprecated (see below) or do not appear in frameset documents. For documents that use this DTD, use this document type declaration:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

Transitional
Includes everything in the strict DTD plus deprecated elements and attributes (most of which concern visual presentation such as alignment and colors). For documents that use this DTD, use this document type declaration:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Frameset
Includes everything in the transitional DTD plus frames as well. For documents that use this DTD, use this document type declaration:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">

This document type declaration must be used and should only be used for documents defining the frames layout, i.e. documents containing FRAMESET and FRAME elements. For documents defining the content of the frames use either the strict or transitional DTD. If you want to use the attribute TARGET, then you have to use the transitional DTD.

### Deprecated elements and attributes

Some elements and attributes are defined as deprecated in the HTML 4.0 specification. A deprecated element or attribute is one that has been outdated by newer constructs such as style sheets. Deprecated elements may become obsolete in future versions of HTML.

The deprecated elements are APPLET, BASEFONT, CENTER, DIR, FONT, ISINDEX, MENU, S, STRIKE, and U. The deprecated attributes are mostly the ones which concerns presentation, such as alignment and colors.

### Extensions to HTML 4.0

Alpha support some extensions to HTML 4.0 which were introduced by Netscape or Microsoft. For documents with a HTML 4.0 document type declaration these are obviously disabled. The elements which are extensions are MULTICOL, SPACER, NOBR, WBR, MARQUEE, BLINK, BGSOUND, EMBED, NOEMBED, KEYGEN, SERVER, LAYER, ILAYER, and NOLAYER.

### Preferences related to DTDs

In the attribute preferences dialog you can specify two preferences which are related to the DTDs.

Don't use extensions to HTML 4.0
HTML elements not included in HTML 4.0 will be disabled in the menu, and attributes not included in HTML 4.0 will not be asked about. Exactly the same set of elements and attributes are used as if the document had included a frameset document type declaration.

Don't use deprecated elements and attributes
Deprecated elements will be disabled in the menu and deprecated attributes will not be asked about (this includes the extensions). The set of elements and attributes and those in the strict DTD plus the ones used for frames. Use this setting when you are defining frames documents but don't want to use deprecated elements or attributes.

When any of these two settings apply and there is also a document type declaration in the document, the largest set of elements and attributes allowed both by the settings and the DTD is used.