HTML 4

     

To balance shifting trends in convention and approach the demand for better standardization across browsers, HTML 4 emerged with some potent rules. These rules, in their strictest incarnation, don't always work in cross-browser/cross-platform design, and they often are not backward compatible. To address these issues, HTML 4 has built-in accommodations for them.

These accommodations are found in the document type definitions (DTDs) found within the HTML 4 specification. DTDs are essentially laundry lists of all the elements, attributes, and syntax conformance rules needed for a document to conform to the real language in question. In formal markup, the DTDs are declared within the document, which you'll see later.

The following DTDs exist in HTML 4:

  • Strict HTML 4 ” This is the purest of HTML 4 interpretations. Anything deprecated (made obsolete) in this version of the language is not used, ever. Most presentational elements and attributes are left out of the interpretation ”you can't use a font tag, for example, when writing a document that conforms to a strict interpretation.

  • Transitional, or "loose" HTML 4 ” By combining aspects of the prior version of HTML (HTML 3.2) with elements from the strict HTML 4 standard, a more realistic, usable version of the language emerges. This is where you will find the most backward compatibility for many public and contemporary Web site designs. In transitional HTML, you can use font tags, attributes for presentation, and tables for layout, and the concern with document structure is slightly less demanding than in strict interpretations. Most readers will likely use transitional HTML (or XHTML 1.0) to accommodate their goals.

  • Frameset HTML 4 ” This includes all the information within the transitional version, combined with the newly adopted frame-based elements such as frame , frameset , noframes , and iframe . The frameset interpretation exists as an interpretation to confirm the standardization of frames within HTML and offer a regulated method of using them.

The standard expects that you will insert the appropriate document version and the document type definition identifying the specification to which the document conforms. So, if you're creating a strict HTML document, the shell of the document should appear with the document version, as shown in Listing 8.1.

Listing 8.1. Sample HTML Strict Document
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> <head> <title>Strict HTML Sample Shell</title> </head> <body> </body> </html> 

Transitional documents appear with the document type and structure, as demonstrated in Listing 8.2.

Listing 8.2. Sample HTML Transitional Document
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>Transitional HTML Sample Shell</title> </head> <body> </body> </html> 

Finally, any page you build with frames in HTML 4 should be denoted as being within the frameset interpretation. Frameset documents contain the frameset version information, as follows :

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd"> 

Along with these interpretations are three primary concepts HTML 4 encourages authors to adopt to ameliorate problems and concerns with the language's past (and often current) use:

  • Separate document structure from presentation and style ” Much of HTML 4 focuses on taking any element from prior language versions used for presentation or style of information and setting it aside. Instead, style sheets for presentation and design are typically recommended.

  • Think carefully about accessibility and internationalization ” Because HTML was originally built for all people to access documents, including those on a variety of platforms, using different languages, using different user agents , and with a special concern for people having physical impairments, the standard asks that we keep these issues in mind when authoring code. A good example of this is adding alt attribute descriptions to img tags, which helps visually impaired users to better understand Web documents.

  • Make documents load more quickly via careful table design ” HTML 4 has several element additions that help tables render incrementally. In fact, HTML 4 highly encourages developers to move away from using tables for an underlying grid system, implementing the use of style sheet positioning in its place.

XHTML builds heavily on these foundations. Whether you choose to employ XHTML or HTML, you should use recommended markup rather than arbitrary markup. This is especially important when you move from HTML into the realm of XML and beyond, because without the foundational concepts and techniques, you run the risk of making mistakes such as introducing proprietary or even nonexistent markup into a document. If that happens, and you try to share that document with another colleague, company, or application, significant problems can ensue.



Using Macromedia Studio MX 2004
Special Edition Using Macromedia Studio MX 2004
ISBN: 0789730421
EAN: 2147483647
Year: N/A
Pages: 339

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