Dreamweaver - Forms - Adding a label
Go to the forms tab on the Insert menu:

Click on the icon to create a new form. In Design view, the form is outlined by a dashed red line.
Once you've created a form, move your cursor inside the form area. Create whatever form element you wish to label. Then click on that form element and click on the icon to create a new label for that element. Click somewhere off the form element, then use the arrow keys to navigate the cursor to immediately in front of the element. Type in whatever text you want to have as the label for the element.
Here's the code for that example:
Notice that when you click on the label or the radio button, the check box is selected. When you click on the text that is not an actual label, the checkbox is not selected. Also, you can attach a label to an object in one of two ways: either by having the label text and the element together within the label tag, or by setting the "for" attribute of the label to the name of the element.
If you want to change the properties of the label, you'll have to go to code view. Find the label tag, then right click on it and select what you want to edit.
Selecting "Edit Tag <input>..." allows you to change all of the attributes at once:
- The "For" field lets you enter the name of the element that the label is for. Using this means that the label and the element do not have to be together within the tag. This is useful when dealing with tables where the labels and elements are in separate 'td' tags.
Select "Edit Tag Code <label>..." if you want to edit the tag properties by hand.
|
|