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" ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.