From the course: Building Great Forms with HTML and CSS

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Styling labels and inputs

Styling labels and inputs

From the course: Building Great Forms with HTML and CSS

Start my 1-month free trial

Styling labels and inputs

- [Instructor] You don't need labels for your form to work, but it can be considered an accessibility crime not to use them. Labels are what signify what the input box is for and it associates them together. The use of the label tag is not only semantically correct, but it gives you the opportunity to style them uniquely with CSS. Labels are not help texts. Use succinct, short, descriptive labels, just a word or two so that users can quickly scan your form. Here's what we're going to be building right now. This is an unstyled form. Everything that you see here is being controlled by the browser. If I expand the browser, you can see that the form fields are going to change the position, and that's because the items currently are inline items. We'll go ahead and create some custom CSS so we can transform this plain form into something that's going to be visually much more appealing and more user-friendly. Let me…

Contents