Danh mục

Web Programming with HTML, XHTML, and CSS Second Edition- P5

Số trang: 50      Loại file: pdf      Dung lượng: 1.01 MB      Lượt xem: 11      Lượt tải: 0    
Jamona

Phí tải xuống: 10,000 VND Tải xuống file đầy đủ (50 trang) 0
Xem trước 5 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Web Programming with HTML, XHTML, and CSS Second Edition- P5: Điều này bắt đầu hướng dẫn nhận xét HTML và cũng giới thiệu đến bạn bằng cách sử dụng XHTML cho cấu trúc của một trang web và cascading style sheets (CSS) để kiểm soát như thế nào một tài liệu sẽ xuất hiện trên một trang web. Bạn se tìm hiểu làm thế nào để tận dụng lợi thế của các tính năng mới của các trình duyệt trong khi đảm bảo rằng các trang của bạn vẫn làm việc ở cũ, nhưng phổ biến, các trình duyệt. Bằng...
Nội dung trích xuất từ tài liệu:
Web Programming with HTML, XHTML, and CSS Second Edition- P5 Chapter 5: Forms Figure 5-20Str ucturing Your Forms with and Elements Large forms can be confusing for users, so it’s good practice to group together related form controls. The and 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 element creates a border around the group of form controls to show that they are related. ❑ The element allows you to specify a caption for the element, which acts as a title for the group of form controls. When used, the element should always be the first child of the 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 (ch05_eg17.html). Contact Information First name: Last name: E-mail: Competition Question How tall is the Eiffel Tower in Paris, France? 584ft 784ft 984ft 1184ft Tiebreaker Question 171Chapter 5: Forms In 25 words or less, say why you would like to win $10,000: Enter competition You can see how the elements create borders around the groups of form controls, and how the elements are used to title the groups of controls. Remember that the element must be the first child of the element when it is used. See Figure 5-21. Figure 5-21 The element can take the following attributes: ❑ All the universal attributes ❑ The basic event attributes Note that if you use a table to format your form, the element must appear inside the element. If a resides within a table that is used to format the page, then the entire fieldset must reside within the same cell.172 Chapter 5: Forms The element can take the following attributes: ❑ accesskey, which you will learn about in the next section ❑ align (which is deprecated — you should use CSS positioning instead) ❑ All of the universal attributes ❑ UI event attributesFocus When a web page featuring several links or several form controls loads, you might have noticed that you are able to use your Tab key to move between those elements (or Shift+Tab to move backward through elements). As you move between them, the web browser tends to add some form of border or highlight- ing to that element (be it a link or a form control). This is known as focus. From what you have learned already about XHTML, you know that not every element in the document receives this focus. In fact, it is only the elements that a user can interact with, such as links and form con- trols, that can receive focus. Indeed, if a user is expected to interact with an element, that element must be able to receive focus. An element can gain focus in three ways: ❑ An element can be selected using a pointing device such as a mouse or trackball. ❑ The elements can be navigated between using the keyboard — often using the Tab key (or Shift+Tab to move backward through elements). The elements in some documents can be given a fixed tabbing order, indicating the order in which elements gain focus. ❑ You can use a system such as a keyboard shortcut known as an access key to select a particular ele- ment. For example, on a PC you would likely press the Alt key plus an access key (such as Alt+E), whereas on a Mac you would press the Control key with an access key (such as Control+E).Tabbing Order If you want to control the order in which elements can gain focus, you can use the tabindex attribute to give that element a number between 0 and 32767, which forms part of the tabbing order. Every time the user presses the Tab key, the focus moves to the element with the next highest tabbing order (and again, Shift+Tab moves focus in reverse order). The following elements can carry a tabindex attribute: The tabindex attribute was first supported in Netscape 6 and IE 4, but older browsers just ignore this attribute, so it is safe to use it in all documents. After a user has tabbed through all elements in a document that can gai ...

Tài liệu được xem nhiều:

Gợi ý tài liệu liên quan: