A Complete Guide to Web Design

(やまだぃちぅ) #1
242 Chapter 12 – Forms

Affecting the Appearance of Forms


Web Design in a Nutshell, eMatter Edition

HTML to make form elements turn on and off, or become hidden or visible based
on user input. Table 12-1 lists the new attributes along with the form elements to
which they can be applied.

Affecting the Appearance of Forms


Form elements are automatically rendered by the browser, giving the designer
little control over the appearance of the controls themselves. Not surprisingly, the
same element may be rendered slightly differently on different browsers and plat-
forms (see Table 12-2).
To make things even more interesting, Netscape will resize form elements
containing text (text fields, text areas, and scrolling lists) when the constant width
font is resized in the browser preferences. So, if a user’s fonts are set to 18 points,
a <textarea> could suddenly become huge, and exceed the space you’ve
allotted. Like many things on the Web, the way your forms will look is somewhat
unpredictable.

Table 12-1: New Form Attributes in HTML 4.0

Attribute Description Related Tag(s)
accept-charset Specifies the list of character
encodings (character sets)
that must be accepted by the
server processing the form. It
is part of the W3C’s interna-
tionalization efforts requiring
alternative character sets to
represent non-Western
writing systems.


accesskey Assigns an access key
(keyboard shortcut) to an
element for quicker access.