WEB DESIGN GARAGE [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

WEB DESIGN GARAGE [Electronic resources] - نسخه متنی

Marc Campbell

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Working with Menus


A menu is very much like a list. The markup is nearly exactly the same, and you use menus to present a large number of options, just like a list. The main difference is that the options appear in a dropdown list, as in Figure 68.7.

Listing 68.7. View Source for Figure 68.7.


<form>
<table>
<tr>
<td>Select the newsletter you would like to receive:</td>
</tr>
<tr>
<td><select name="select">
<option value="news" selected>News</option>
<option value="sports">Sports</option>
<option value="business">Business</option>
<option value="entertainment">Entertainment</option>
<option value="humor">Humor</option>
<option value="style">Style</option>
<option value="travel">Travel</option>
<option value="science">Science</option>
<option value="culture">Culture</option>
</select></td>
</tr>
</table>
</form>

Figure 68.7. Use a menu instead of a list if you prefer the compact look of the menu.

[View full size image]

Look very carefully in the View Source for Figure 68.7, and you see that what makes the difference between a menu and a list is the absence of the size attribute in the select tag.


TIP


You should always preselect one option in a menu. Otherwise, the menu appears blank until the visitor opens the dropdown list.

Otherwise, the attributes in a menu are identical in number and function, and the data that the Web server receives looks much the same. In addition, you can add the multiple and selected attributes to the select and option tags of a menu, just as in a list, although doing this turns the menu into a list.


/ 175