September 16, 2003 · Dan Cederholm

SimpleQuiz › Part VI › Form(atting)

Let's talk forms. A lot my web design headaches are caused while formatting form items. This quiz question comes to us from MikeyC:

Q: When marking up forms, which is more semantically correct when separating form items?

  1. <form>
    <p><label for="name">Name:</label>
    <input type="text" id="name" /></p>
    </form>
  2. <form>
    <div>
    <label for="name">Name:</label>
    <input type="text" id="name" />
    </div>
    </form>
  3. <form>
    <label for="name">Name:</label>
    <input type="text" id="name" /><br /><br />
    </form>

See all previous quiz questions and wrap-ups.