259
CHAPTER
Adding Forms to Your Site 11
● When the page is viewed in
the browser, the check boxes
appear. Any or all of them
may be selected at the same
time.
7 Within the form, type
.
9 Repeat Steps 2 to 8 to add
additional check boxes.
Note: Be sure that all of the
name attributes are the same.
7
8
9
TIPS
Can I have check boxes that are prechecked when
the page loads?
Yes. Each check box accepts an optional checked
attribute, which preselects the check box when
added. If you are using HTML, you can simply add
checked to the tag; XHTML, on the other hand,
requires that attributes have values, so you must
write checked=”checked” to precheck a box in
XHTML.
How can I lay out my check boxes?
If you want to have each check box on its own line,
you can simply add an HTML line break tag, <br>,
after each one. Alternately, you can use CSS layout
properties. See Chapter 6 for more about CSS layout
properties.