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

Creating Text Boxes

Text boxes can contain one line of freeform text—that is, anything that the visitor wants to type—and are typically used for names, addresses, and the like.

There are many ways to separate your form elements from each other. In these examples, we are using unordered lists Image, but you can also use the div, p, or br elements to organize your form elements.

Image While it’s essential to set the name attribute for each text box, you only have to set the value attribute when you want to add default values for a text box.

<form method="post" ...

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