Why use definition lists (DL,DD,DT) tags for HTML forms instead of tables?

前端 未结 11 1610
醉酒成梦
醉酒成梦 2020-12-02 06:29

I\'ve come across a few examples recently that do things like:

Full Name:
11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-02 07:11

    I've successfully used the technique outlined in this article several times.

    I agree with sjstrutt that you should use form related tags like label and form in you forms, but the HTML outlined in his example, will often lack some code you can use as "hooks" for styling your form with CSS.

    As a consequence of this I markup my forms like this:

    Form header

    This approach leaves me with a comprehensible set of tags, which contains enough hooks to style the forms in a lot of different ways.

提交回复
热议问题