HTML and CSS Reference
In-Depth Information
Quoted Attribute Values
All attributes must include values in XHTML. All attribute values must be quoted (Listing 3-19). Unquoted attribute
values are not allowed in XHTML (Listing 3-20).
Listing 3-19. Defining XHTML Attributes Correctly
<input type="checkbox" name="checkbox" id="checkbox" value="True" checked="checked" />
Listing 3-20. Unquoted and Minimized Attributes (Incorrect in XHTML)
<input type=checkbox name=checkbox id=checkbox value=True checked />
No Attribute Minimization
Attribute-value pairs must be written in full (Listing 3-21). Attribute minimization is not supported by XHTML
(Listing 3-22). Attribute names such as compact and checked cannot be used in elements without specifying their
values (Table 3-3 ).
Listing 3-21. Attributes Should Be Written in Full
<option value="eng" selected="selected" >English</option>
Listing 3-22. Minimized Attribute (Incorrect in XHTML)
<option value="eng" selected>English</option>
Table 3-3. Attributes That Can Be Minimized in HTML, but Not in XHTML
Minimized Attribute (HTML)
Full Form (HTML/XHTML)
compact
compact="compact"
checked
checked="checked"
declare
declare="declare"
readonly
readonly="readonly"
disabled
disabled="disabled"
selected
selected="selected"
defer
defer="defer"
ismap
ismap="ismap"
nohref
nohref="nohref"
noshade
noshade="noshade"
nowrap
nowrap="nowrap"
multiple
multiple="multiple"
noresize
noresize="noresize"
 
 
Search WWH ::




Custom Search