HTML and CSS Reference
In-Depth Information
16.3.6. Explicit Attribute Values
Within HTML, there are a small number of attributes that have no value.
Instead, their mere presence within a tag causes that tag to behave dif-
ferently. In general, these attributes represent a sort of on/off switch for
the tag, like the compact attribute for the various list tags or the ismap
attribute for the <img> tag.
In XHTML, every attribute must have a value. Those without values
must use their own names. Thus, compact in XHTML is correctly specified
as compact= "compact", and checked becomes checked="checked" . Each
must contain the required attribute value enclosed in quotes. Table 16-2
contains a list of attributes with the required XHTML values.
Table 16-2. XHTML values for valueless HTML attributes
checked="checked"
compact="compact"
declare="declare"
defer="defer"
disabled="disabled"
ismap="ismap"
multiple="multiple"
noresize="noresize"
noshade="noshade"
nowrap="nowrap"
readonly="readonly"
selected="selected"
Be aware that this attribute value requirement may cause some old
HTML browsers to ignore the attribute altogether. All the modern
browsers don't have that problem, so the vast majority of users won't
notice any difference. There is no good solution to this problem, other
than distributing HTML 4.0-compliant browsers to the needy.
 
Search WWH ::




Custom Search