HTML and CSS Reference
5. Save your contact.html file and test in a recent browser. It should look similar to
the one shown in Figure 9.19. You can compare your work with the solution
found in the student files (Chapter9/9.3). You may notice that when you activate
the submit button, the form redisplays. This is because there is no action
property in the <form> element. You'll work with setting the action property
in Section 9.5.
1. Describe the purpose of the <fieldset> and <legend> tags.
2. Describe the purpose of the accesskey attribute and how it supports accessibility.
3. When designing a form, should you use the standard submit button, an image button,
or a button tag? Are these different in the way that they provide for accessibility?
Explain your answer.
As you have worked with forms in this chapter, you may have noticed that the standard
submit button (see Figure 9.12) is a little plain. You can make the form area that you
click to submit the form more compelling and visually interesting in two ways: by
creating custom images that are configured with the <input /> tag or by using the
Figure 9.20 shows an image used in place of the standard submit button. This is called
an image button. When an image button is clicked, the form is submitted. The image
button is coded using the <input /> tag along with type="image" and a src attribute
with the value of the name of the image file. For example, to use the image called
login.gif as an image button the XHTML code is as follows:
<input type="image" src="login.gif" alt="Login Button" />
The Web page
visitor will click the
image button to
submit the form
Another way to add more interest to a form is to use the <button> element. This ele-
ment can be used to configure not only images but also blocks of text as the clickable
area that can submit or reset a form. The <button> tag is a container tag. Any Web
page content that is between the <button> and </button> tags is configured to be part
of the button. Table 9.12 lists common attributes of the <button> tag.