HTML and CSS Reference
In-Depth Information
Creating a Check Box
• To create a check box, add the element
<input type=”checkbox” name=”
name
” value=”
value
” />
to the Web form, where
name
is the name of the data field and
value
is the data field
value if the check box is selected.
• To specify that a check box is selected by default, add the following attribute to the
input
element:
checked=”checked”
You'll add a check box below the two field sets asking customers whether they would
like to receive the Red Ball Pizza e-mail newsletter.
To create a check box inviting customers to subscribe:
◗
1.
Return to the
survey.htm
file in your text editor.
◗
2.
Directly above the closing
</form>
tag, insert the following code (see
Figure 6-45):
<label id=”newsletter”>
<input type=”checkbox” name=”newscb” />
E-mail me your newsletter for great coupons and specials!
</label>
figure 6-45
creating a check box for the newscb field
◗
3.
Save your changes to the file.
Next, you'll design a style rule for the label text and check box control.