From the course: Building Great Forms with HTML and CSS

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Working with labels

Working with labels

- [Instructor] A label is used to create a caption for a form control. And they describe the purpose and function of form elements. Labels are critical because they tell the user what information to provide in the form element. Without them we really would be lost. Clearly written labels are one of the primary ways to make a UI more accessible. A good label tells the user the purpose of the field, maintains its usefulness when focus is on the field itself and remains visible even after the field has been filled in. The label text is not only visually associated with its corresponding text input, it is also programmatically associated with it. This means that for example, a screen reader will read out the label when the user is focused on the form input, making it easier for an assistive technology user to understand what data should be entered. You can click the associated label to focus the active input as well as clicking…

Contents