HTML and CSS Reference
In-Depth Information
to indicate which value is sent to the server when the button is clicked. Unlike buttons
created with the <input> tag, the button's label is specified by the content within the
<button> tag, as shown in this code:
<button type=“submit”><b><i> Submit button </i></b></button>
<button type=“custom”><img src=“recycle.gif”></button>
The button element is shown in a browser in Figure 11.12.
FIGURE 11.12
The button
element provides
a more flexible
way to create form
With the <button> tag, white space counts. If you include whitespace between the open-
ing or closing <button> tags and the content inside the tag, it might make your button
look a bit odd. The best bet is to just leave out that whitespace.
Creating Large Text-Entry Fields with textarea
The textarea element creates a large text entry field where people can enter as much
information as they like. To create a textarea , use the <textarea> tag. To set the size of
the field, use the rows and cols attributes. These attributes specify the height and width
of the text area in characters. A text area with cols set to 5 and rows set to 40 creates a
field that's 5 lines of text high and 40 characters wide. If you leave out the rows and
cols attributes, the browser default will be used. This can vary, so you should make sure
to include those attributes to maintain the form's appearance across browsers. The clos-
ing textarea tag is required and any text you place inside the textarea tag is displayed
inside the field as the default value:
<label for=”question4” style=”display: block”> Please comment on our customer
service. </label>
<textarea name=“question4” rows=“10” cols=“60”> Enter your answer here
Search WWH ::

Custom Search