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

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

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

Full Name:
11条回答
  •  攒了一身酷
    2020-12-02 06:58

    In this case, labels and inputs are your semantic meaning and they stand on their own.

    Imagine you had to read the web page, out load, to a blind person. You wouldn't say "Okay, I have a list of definitions here. The first term is 'name'." Instead, you'd probably say "Okay we have a form here and it looks like the there's a set of fields, the first input is labeled 'name'."

    This is why the semantic web is important. It allows the content of the page to represent itself accurately to both humans and technology. For example, there are many browser plugins that help people quickly fill out web forms with their standard information (name, phone number, etc). These rarely work well if inputs don't have associated labels.

    Hope that helps.

提交回复
热议问题