HTML 5 <details> 標簽
定義和用法
<details> 標簽定義元素的細節(jié),用戶可進行查看,或通過點擊進行隱藏。
HTML 4.01 與 HTML 5 之間的差異
<details> 標簽是 HTML 5 中的新標簽。
提示和注釋
提示:與 <legend> 一起使用,來制作 detail 的標題。該標題對用戶是可見的,當在其上點擊時可打開或關閉 detail。
屬性
屬性 | 值 | 描述 |
---|---|---|
open | true | false | 定義 details 是否可見。默認是 false。 |
標準屬性
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 中事件屬性。