O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Labeling Form Parts

HTML provides a method for marking up labels so that you can formally link them to the associated element and use them for scripting or other purposes. In the examples so far, you’ve seen that the explanatory information for each form element is inside a label element with a for attribute.

For example, you might have “First Name:” before the text field where the visitor should type his or her first name Image.

Image Marking field labels in a formal way gives you an easy way to identify them in a CSS style sheet. If you use the for attribute ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required