Read HTML The Definitive Guide Online
Authors: Chuck Musciano Bill Kennedy
anchor tag (). When the user clicks somewhere in the image, the graphical browser sends the relative x,y coordinates of the mouse position to the server that is also designated in the anchor. A special server program then translates the image coordinates into some special action, such as
downloading another HTML document. [Server-side considerations , 7.5.1.1]
A good example of the use of an image map might be to locate a hotel while traveling. The user clicks on a map of the region they intend to visit, for instance, and your image map's server program might return the names, addresses, and phone numbers of local accommodations.
While very powerful and visually appealing, these standard so-called
server-side
image maps mean that HTML authors must have some access to the map's coordinate-processing program on the server.
Many authors don't even have access to the server. A better solution is to take advantage of
client-side
image maps.
Rather than depending on a web server, the usemap attribute for the tag and the
authors. [Client-side Image Maps, 7.5.2]
2.7 Hyperlinks
2.9 Lists, Searchable
Documents, and Forms
2.9 Lists, Searchable Documents, and Forms
Thought we'd exhausted HTML text elements? Headers, paragraphs, and line breaks are just the rudimentary text-organizational elements of an HTML document. The language also provides several advanced text-based structures, including three types of lists, "searchable" documents, and forms.
Searchable documents and forms go beyond text formatting, too; they are a way to interact with your readers. Forms let users enter text and click checkboxes and radio buttons to select particular items and then send that information back to the server. Once received, a special server application processes the form's information and responds accordingly, e.g., filling a product order or collecting
data for a user survey.[6]
[6] The server-side programming required for processing forms is beyond the scope of this book. We give some basic guidelines in the appropriate chapters, but please consult the server documentation and your server administrator for details.
The HTML syntax for these special features and their various attributes can get rather complicated; they're not quick-start grist. So we mention them here and urge you to read on for details in later chapters.
2.9.1 Unordered, Ordered, and Definition Lists
The three types of HTML lists match those we are most familiar with: unordered, ordered, and definition lists. An unordered list - one in which the order of items is not important, such as a laundry or grocery list - gets bounded by
Ordered lists, bounded by the
Definition lists are slightly more complicated than unordered and ordered lists. Within a definition list's enclosing
The various types of lists may contain nearly any type of content normally allowed in the body of the HTML document. So you can organize your collection of digitized family photographs into an ordered list, for example, or put them into a definition list complete with text annotations. HTML
even lets you put lists inside of lists (nesting), opening up a wealth of interesting combinations.
2.9.2 Searchable Documents
The simplest type of user interaction provided by HTML is the
searchable
document. You create a searchable HTML document by including an
7
]
[
[7] Few authors have used the tag, apparently. The
The processing application on the server uses those keywords to do some special task, such as perform a database search or match the keywords against an authentication list to allow the user special access to some other part of your document collection.
2.9.3 Forms
Obviously, searchable documents are very limited - one per document and only one user input element. Fortunately, HTML provides better, more extensive support for collecting user input though
forms
.
You create one or more special form sections in your HTML document, bounded with the
tags. Inside the form, you may put predefined as well as customized text-input boxes allowing for both single and multiline input. You may also insert checkboxes and radio buttons for single-and multiple-choice selections, and special buttons that work to reset the form or send its contents to the server. Users fill out the form at their leisure, perhaps after reading the rest of the document, and then click a special send button that makes the browser send the form's data to the server. A special server-side program you provide then processes the form and responds accordingly, perhaps by requesting more information from the user, modifying subsequent HTML documents the