Cari di HTML4 
    HTML4 User Manual
Daftar Isi
(Sebelumnya) 1. About the HTML 4 Specification3. On SGML and HTML (Berikutnya)

2. Introduction to HTML 4

2.1 What is the World Wide Web?

The World Wide Web (Web) is anetwork of information resources. The Web relies on three mechanisms to makethese resources readily available to the widest possible audience:

  1. A uniform naming scheme for locating resources on the Web (e.g.,URIs).
  2. Protocols, for access to named resources over the Web (e.g., HTTP).
  3. Hypertext, for easy navigation among resources (e.g., HTML).

The ties between the three mechanisms are apparent throughout thisspecification.

2.1.1 Introduction toURIs

Every resource available on the Web -- HTML document, image, video clip,program, etc. -- has an address that may be encoded by a Universal ResourceIdentifier, or "URI".

URIs typically consist of three pieces:

  1. The naming scheme of the mechanism used to access the resource.
  2. The name of the machine hosting the resource.
  3. The name of the resource itself, given as a path.

Consider the URI that designates the W3C Technical Reports page:

   http://www.w3.org/TR

This URI may be read as follows: There is a document available via the HTTPprotocol (see [RFC2616]), residing on the machine www.w3.org, accessible viathe path "/TR". Other schemes you may see in HTML documents include "mailto"for email and "ftp" for FTP.

Here is another example of a URI. This one refers to a user's mailbox:

   ...this is text...   For all comments, please send email to <A href="mailto:[email protected]">Joe Cool</A>.

Note. Most readers may be familiar with the term "URL" and not the term "URI". URLs form a subset of the more generalURI naming scheme.

2.1.2 Fragmentidentifiers

Some URIs refer to a location within a resource. This kind of URI ends with"#" followed by an anchor identifier (called the fragmentidentifier). For instance, here is a URI pointing to an anchornamed section_2:

http://somesite.com/html/top.html#section_2

2.1.3 Relative URIs

A relative URI doesn't contain anynaming scheme information. Its path generally refers to a resource on the samemachine as the current document. Relative URIs may contain relative pathcomponents (e.g., ".." means one level up in the hierarchy defined by thepath), and may contain fragment identifiers.

Relative URIs are resolved to full URIs usinga base URI. As an example of relative URI resolution, assume we have the baseURI "http://www.acme.com/support/intro.html". The relative URI in the followingmarkup for a hypertext link:

   <A href="suppliers.html">Suppliers</A>

would expand to the full URI "http://www.acme.com/support/suppliers.html",while the relative URI in the following markup for an image

   <IMG src="../icons/logo.gif" alt="logo">

would expand to the full URI "http://www.acme.com/icons/logo.gif".

In HTML, URIs are used to:

  • Link to another document or resource, (see the Aand LINK elements).
  • Link to an external style sheet or script (see the LINK and SCRIPT elements).
  • Include an image, object, or applet in a page, (see the IMG, OBJECT, APPLET and INPUT elements).
  • Create an image map (see the MAP and AREA elements).
  • Submit a form (see FORM).
  • Create a frame document (see the FRAME and IFRAME elements).
  • Cite an external reference (see the Q, BLOCKQUOTE, INS and DEL elements).
  • Refer to metadata conventions describing a document (see the HEAD element).

Please consult the section on the URItype for more information about URIs.

2.2 What is HTML?

To publish information for global distribution, one needs a universallyunderstood language, a kind of publishing mother tongue that all computers maypotentially understand. The publishing language used by the World Wide Web isHTML (from HyperText Markup Language).

HTML gives authors the means to:

  • Publish online documents with headings, text, tables, lists, photos,etc.
  • Retrieve online information via hypertext links, at the click of abutton.
  • Design forms for conducting transactions with remote services, for use insearching for information, making reservations, ordering products, etc.
  • Include spread-sheets, video clips, sound clips, and other applicationsdirectly in their documents.

2.2.1 A brief history of HTML

HTML was originally developed by Tim Berners-Lee while at CERN, andpopularized by the Mosaic browser developed at NCSA. During the course of the1990s it has blossomed with the explosive growth of the Web. During this time,HTML has been extended in a number of ways. The Web depends on Web page authorsand vendors sharing the same conventions for HTML. This has motivated jointwork on specifications for HTML.

HTML2.0 (November 1995, see [RFC1866]) was developedunder the aegis of the InternetEngineering Task Force (IETF) to codify common practice in late1994. HTML+ (1993) and HTML 3.0 (1995, see [HTML30]) proposed much richer versions of HTML. Despite never receivingconsensus in standards discussions, these drafts led to the adoption of a rangeof new features. The efforts of the World Wide Web Consortium's HTML WorkingGroup to codify common practice in 1996 resulted in HTML 3.2 (January1997, see [HTML32]). Changes from HTML 3.2 are summarized in Appendix A

Most people agree that HTML documents should work well across differentbrowsers and platforms. Achieving interoperability lowers costs to contentproviders since they must develop only one version of a document. If the effortis not made, there is much greater risk that the Web will devolve into aproprietary world of incompatible formats, ultimately reducing the Web'scommercial potential for all participants.

Each version of HTML has attempted to reflect greater consensus amongindustry players so that the investment made by content providers will not bewasted and that their documents will not become unreadable in a short period oftime.

HTML has been developed with the vision that all manner of devices should beable to use information on the Web: PCs with graphics displays of varyingresolution and color depths, cellular telephones, hand held devices, devicesfor speech for output and input, computers with high or low bandwidth, and soon.

2.3 HTML 4

HTML 4 extends HTML with mechanisms for style sheets, scripting, frames,embedding objects, improved support for right to left and mixed direction text,richer tables, and enhancements to forms, offering improved accessibility forpeople with disabilities.

HTML 4.01 is a revision of HTML 4.0 that corrects errors and makes some changes since the previous revision.

2.3.1 Internationalization

This version of HTML has been designed with the help of experts in the fieldof internationalization, so that documents may be written in every language andbe transported easily around the world. This has been accomplished byincorporating [RFC2070], which deals with the internationalization ofHTML.

One important step has been the adoption of the ISO/IEC:10646 standard (see[ISO10646]) as the document character set for HTML. This is the world'smost inclusive standard dealing with issues of the representation ofinternational characters, text direction, punctuation, and other world languageissues.

HTML now offers greater support for diverse human languages within adocument. This allows for more effective indexing of documents for searchengines, higher-quality typography, better text-to-speech conversion, betterhyphenation, etc.

2.3.2 Accessibility

As the Web community grows and its members diversify in their abilities andskills, it is crucial that the underlying technologies be appropriate to theirspecific needs. HTML has been designed to make Web pages more accessible tothose with physical limitations. HTML 4 developments inspired by concerns foraccessibility include:

  • Better distinction between document structure and presentation, thusencouraging the use of style sheets instead of HTML presentation elements andattributes.
  • Better forms, including the addition of access keys, the ability to groupform controls semantically, the ability to group SELECT options semantically, and active labels.
  • The ability to markup a text description of an included object (with the OBJECT element).
  • A new client-side image map mechanism (the MAP element) that allows authors to integrate image and textlinks.
  • The requirement that alternate text accompany images included with the IMG element and image maps included with the AREA element.
  • Support for the title and lang attributes on all elements.
  • Support for the ABBR and ACRONYM elements.
  • A wider range of target media (tty, braille, etc.) for use with stylesheets.
  • Better tables, including captions, column groups, and mechanisms tofacilitate non-visual rendering.
  • Long descriptions of tables, images, frames, etc.

Authors who design pages with accessibility issues in mind will not onlyreceive the blessings of the accessibility community, but will benefit in otherways as well: well-designed HTML documents that distinguish structure andpresentation will adapt more easily to new technologies.

Note. For more information about designing accessibleHTML documents, please consult [WAI].

2.3.3 Tables

The new table model in HTML is based on [RFC1942]. Authors nowhave greater control over structure and layout (e.g., column groups). Theability of designers to recommend column widths allows user agents to displaytable data incrementally (as it arrives) rather than waiting for the entiretable before rendering.

Note. At the time of writing, some HTML authoring toolsrely extensively on tables for formatting, which may easilycause accessibility problems.

2.3.4 Compound documents

HTML now offers a standard mechanism for embedding generic media objects andapplications in HTML documents. The OBJECT element (together with its more specific ancestor elements IMG and APPLET) provides a mechanism for includingimages, video, sound, mathematics, specialized applications, and other objectsin a document. It also allows authors to specify a hierarchy of alternaterenderings for user agents that don't support a specific rendering.

2.3.5 Style sheets

Style sheets simplify HTML markup and largely relieve HTML of theresponsibilities of presentation. They give both authors and users control overthe presentation of documents -- font information, alignment, colors, etc.

Style information can be specified for individual elements or groups ofelements. Style information may be specified in an HTML document or in externalstyle sheets.

The mechanisms for associating a style sheet with a document is independentof the style sheet language.

Before the advent of style sheets, authors had limited control overrendering. HTML 3.2 included a number of attributes and elements offeringcontrol over alignment, font size, and text color. Authors also exploitedtables and images as a means for laying out pages. The relatively long time ittakes for users to upgrade their browsers means that these features willcontinue to be used for some time. However, since style sheets offer morepowerful presentation mechanisms, the World Wide Web Consortium will eventuallyphase out many of HTML's presentation elements and attributes. Throughout thespecification elements and attributes at risk are marked as "deprecated". They are accompanied by examplesof how to achieve the same effects with other elements or style sheets.

2.3.6 Scripting

Through scripts, authors may create dynamic Web pages (e.g., "smart forms"that react as users fill them out) and use HTML as a means to build networkedapplications.

The mechanisms provided to include scripts in an HTML document areindependent of the scripting language.

2.3.7 Printing

Sometimes, authors will want to make it easy for users to print more thanjust the current document. When documents form part of a larger work, therelationships between them can be described using the HTML LINK element or using W3C's Resource Description Framework (RDF) (see [RDF10]).

2.4 Authoring documents with HTML 4

We recommend that authors and implementors observe the following generalprinciples when working with HTML 4.

2.4.1 Separate structure and presentation

HTML has its roots in SGML which has always been a language for thespecification of structural markup. As HTML matures, more and more of itspresentational elements and attributes are being replaced by other mechanisms,in particular style sheets. Experience has shown that separating the structureof a document from its presentational aspects reduces the cost of serving awide range of platforms, media, etc., and facilitates document revisions.

2.4.2 Consider universal accessibility to theWeb

To make the Web more accessible to everyone, notably those withdisabilities, authors should consider how their documents may be rendered on avariety of platforms: speech-based browsers, braille-readers, etc. We do notrecommend that authors limit their creativity, only that they consideralternate renderings in their design. HTML offers a number of mechanisms tothis end (e.g., the alt attribute, the accesskey attribute, etc.)

Furthermore, authors should keep in mind that their documents may bereaching a far-off audience with different computer configurations. In orderfor documents to be interpreted correctly, authors should include in theirdocuments information about the natural language and direction of the text, howthe document is encoded, and other issues related to internationalization.

2.4.3 Help user agents with incrementalrendering

By carefully designing their tables and making use of new table features inHTML 4, authors can help user agents render documents more quickly. Authors canlearn how to design tables for incremental rendering (see the TABLE element). Implementors should consult the notes on tables in the appendix forinformation on incremental algorithms.

Copyright © 1997-1999 W3C® (MIT, INRIA, Keio), All Rights Reserved.
(Sebelumnya) 1. About the HTML 4 Specification3. On SGML and HTML (Berikutnya)