HTML and CSS Reference
In-Depth Information
As shown in Figure 20-1, the legend is, by default, displayed within the border surrounding the fieldset.
You can, of course, use CSS to modify both the border and the legend text; designers might, for example,
assign a background color to the fieldset selector to further distinguish the form control group.
FiGure 20-1
You can use as many fieldset/legend combinations as you would like in a form. For complex forms,
they can certainly help guide the user to a successful form completion and submission.
Try iT
In this Try It you learn how to add a fieldset and legend to a form.
Lesson requirements
You will need the tpa_saturn.html file from the Lesson_20 folder, as well as a text editor and web
browser.
You can download the code and resources for this lesson from the topic's web
page at www.wrox.com .
step-by-step
1.
Open your text editor.
2.
From the Lesson_20 folder, open tpa_saturn.html .
3.
Put your cursor after the opening <form> tag and press Enter (Return).
Search WWH ::




Custom Search