Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

342 LESSON 12: Designing Forms


Output ▼


FIGURE 12.18
Use textarea to
create large text-
entry areas.

You can also change the size of a textarea with the height and
width CSS properties. This will override any cols or rows attri-
butes you have set. You can alter the font in the text area using
the CSS font properties, too.

TIP

Creating Menus with select and option


The select element creates a menu that can be configured to enable users to select one
or more options from a pull-down menu or a scrollable menu that shows several options
at once. The <select> tag defines how the menu will be displayed and the name of the
parameter associated with the field. The <option> tag is used to add selections to the
menu. The default appearance of select lists is to display a pull-down list that enables the
user to select one of the options. Here’s an example of how one is created:

Input ▼
<label for="location">Please pick a travel destination</label>
<select id="location">
<option>Indiana</option>
<option>Fuji</option>
<option>Timbuktu</option>
<option>Alaska</option>
</select>

As you can see in the code, the field name is assigned using the id attribute of the
<select> tag. The field created using that code appears in Figure 12.19.
Free download pdf