开发者

Better to wrap forms in divs or list items

Is it best to wrap forms inputs in divs:

<div id="formContainer">
   <div>
       <label for="username">Username</开发者_如何学Clabel><input type="text" id="username">
   </div>
   <div>
       <label for="password">Password</label><input type="text" id="password">
   </div>
</div>

Or is it better to wrap in ul or ol list with list-style-type set to none

<ol id="formContainer">
   <li>
       <label for="username">Username</label><input type="text" id="username">
   </li>
   <li>
       <label for="password">Password</label><input type="text" id="password">
   </li>
</ol>

Or does it matter at all?


I would opt with a definition list:

<dl>
    <dt><label for='name'>blah</label></dt>
    <dd><input type='text'></dd>
</dl>


I always use tables because that makes it so easy to align the fields.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜