- HTML 教程
- HTML 5简介
- HTML 5 视频
- HTML 5 音频
- HTML 5 Canvas
- HTML 5 Web 存储
- HTML 5 Input 类型
- HTML 5 表单元素
- HTML 5 表单属性
- HTML 5 参考手册
- HTML 5 标准事件属性
- <!-->
- <!DOCTYPE>
- <abbr>
- <acronym>
- <address>
- <applet>
- <area>
- <article>
- <aside>
- <audio>
- <b>
- <base>
- <basefont>
- <bdo>
- <blockquote>
- <body>
- <br />
- <button>
- <canvas>
- <caption>
- <center>
- <em> <strong> <dfn> <code> <samp> <kbd> <var> <cite> 标签
- <col>
- <colgroup>
- <command>
- <datalist>
- <dd>
- <del>
- <details>
- <dir>
- <div>
- <dl>
- <dt>
- <embed>
- <fieldset>
- <figcaption>
- <figure>
- <font>
- <footer>
- <form>
- <frame>
- <frameset>
- <h1> 至 <h6>
- <head>
- <header>
- <hgroup>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <keygen>
- <em> <strong> <dfn> <code> <samp> <kbd> <var> <cite>
- <label>
- <legend>
- <li>
- <link>
- <map>
- <mark>
- <menu>
- <meta>
- <meter>
- <nav>
- <noframes>
- <object>
- <ol>
- <optgroup>
- <option>
- <output>
- <p>
- <param>
- <pre>
- <progress>
- <q>
- <rp>
- <rt>
- <ruby>
- <s>
- <script>
- <section>
- <select>
- <small>
- <source>
- <span>
- <strike>
- <style>
- <sub> 和 <sup>
- <summary>
- <table>
- <tbody>
- <td>
- <textarea>
- <tfoot>
- <th>
- <thead>
- <time>
- <title>
- <tr>
- <tt>
- <u>
- <ul>
- <video>
定义和用法
<legend> 标签为 <fieldset>、<figure> 以及 <details> 元素定义标题。
HTML 4.01 与 HTML 5 之间的差异
在 HTML 4.01 中, <legend> 仅用于 <fieldset> 元素。
在 HTML 5 中, <legend> 标签应用于 <fieldset>、<figure> 以及 <details> 元素。
在 HTML 5 中,不支持 align 属性。请使用 CSS 代替。
例子
<fieldset> <legend>健康信息:</legend> <form> <label>身高:<input type="text" /></label> <label>体重:<input type="text" /></label> </form> </fieldset>
属性
标准属性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark,
tabindex, template, title
如需完整的描述,请访问 HTML 5 中标准属性。
事件属性
onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend,
ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup,
onmousewheel, onresize, onscroll, onselect, onsubmit, onunload
如需完整的描述,请访问 HTML 5 中事件属性。
TIY 实例围绕数据的 Fieldset
本例演示如何在数据周围绘制一个带标题的框。
<html> <body> <fieldset> <legend>健康信息:</legend> <form> <label>身高:<input type="text" /></label> <label>体重:<input type="text" /></label> </form> </fieldset> <p>如果表单周围没有边框,说明您的浏览器太老了。</p> </body> </html>