当前位置: 代码迷 >> HTML/CSS >> HTML5 施用fieldset 标签给元素分组
  详细解决方案

HTML5 施用fieldset 标签给元素分组

热度:190   发布时间:2012-09-08 10:48:07.0
HTML5 使用fieldset 标签给元素分组

下面的例子展示了,如何使用<FIELDSET>给元素分组, 如何使用<LEGEND>标签。

?

?

<!DOCTYPE html>
<html>
<head>
</head>
<body>
 
    <fieldset>
        <legend>Comments form</legend>
        <table>
            <tr>
                <th>Username:</th>
                <td><input id="usrnm" type="email" name="username" placeholder="user@domain.com" /></td>
            </tr>
            <tr>
                <th>Password:</th>
                <td><input id="psswd" type="password" name="password" placeholder="Top secret password" /></td>
            </tr>
            <tr>
                <th>Comments:</th>
                <td><textarea id="cmmnts" cols="30" rows="5" placeholder="Comments"></textarea></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td><input id="submitBtn" type="submit" value="Submit" /></td>
            </tr>
        </table>
    </fieldset>
 
</body>
</html>

?源码下载:

?fieldset.zip