Chapter 73. Working with Labels

In the spirit of good markup and to satisfy the standards police like the World Wide Web Consortium (W3C), you may be wondering how to mark up the labels of your form. The widgets have their own tags, so no worries there. And you probably lay out your form in a table structure, which has its own set of tags. But what about the text inside the form that describes what your visitors should type into the fields? In other words, what about the labels?

You might be tempted to use the familiar text tags for the job, like paragraph tags or some species of heading. The problem is, your tags should accurately identify the type of elements they mark up. A label in a form isn't really a paragraph. It isn't a heading, either, ...

Get Web Design Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.