tailieunhanh - Web Programming with HTML, XHTML, and CSS- P5
Web Programming with HTML, XHTML, and CSS- P5: There are a lot of books about designing and building web pages, so thank you for picking up this one. Why do I think it is different? Well, the Web has been around for over a decade now, and during its life many technologies have been introduced to help you create web pages, some of which have lasted, others of which have disappeared. Many books that teach you to write web pages are revisions of earlier versions of the same book and therefore still take the same approach as the previous edition did | Chapter 5 Forms Figure 5-20 Structuring Your Forms with fieldset and legend Elements Large forms can be confusing for users so it s good practice to group together related form controls. The fieldset and legend elements do exactly this help you group controls. Both elements were introduced in IE 4 and Netscape 6 however older browsers will just ignore these elements so you are safe to include them in all your forms. The fieldset element creates a border around the group of form controls to show that they are related. The legend element allows you to specify a caption for the fieldset element which acts as a title for the group of form controls. When used the legend element should always be the first child of the fieldset element. In the following example you can see how a form has been divided into four sections contact information competition question tiebreaker question and enter the competition . form action http method post name frmComp fieldset legend em Contact Information em legend label First name input type text name txtFName size 20 label br label Last name input type text name txtLName size 20 label br label E-mail input type text name txtEmail size 20 label br fieldset fieldset legend em Competition Question em legend How tall is the Eiffel Tower in Paris France br label input type radio name radAnswer value 584 584ft label br label input type radio name radAnswer value 784 784ft label br label input type radio name radAnswer value 984 984ft label br label input type radio name radAnswer value 1184 1184ft label br fieldset fieldset legend em Tiebreaker Question em legend 171 Chapter 5 Forms label In 25 words or less say why you would like to win 10 000 textarea name txtTiebreaker rows 10 cols 40 textarea label fieldset fieldset legend em Enter competition em legend input type submit value Enter Competition fieldset form You can see how the fieldset elements create borders around the groups of form controls
đang nạp các trang xem trước