1 回答

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊
<dd>
是的,a包含 a是有效的<ul>
。根據(jù)HTML 規(guī)范,<dd>
元素應(yīng)該包含流內(nèi)容。無序列表被視為流內(nèi)容。
但是,如果示例中的每個(gè)項(xiàng)目都是前面術(shù)語的替代描述<dt>
,則不應(yīng)將它們標(biāo)記在無序列表中,而應(yīng)使用一系列<dd>
元素進(jìn)行標(biāo)記。
例如,以下內(nèi)容是有效的 HTML,但在語義上不正確- 因?yàn)樗馕吨麄€(gè)列表是該術(shù)語的單一描述。
<dl>
? <dt>Firefox</dt>
? <dd>
? ? <ul>
? ? ? <li>A free, open source, cross-platform, graphical web browser developed by the Mozilla Corporation and hundreds of volunteers.</li>
? ? ? <li>The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long).</li>
? ? </ul>
? </dd>
</dl>
標(biāo)記此內(nèi)容的有效且語義正確的方法是:
<dl>
? <dt>Firefox</dt>
? <dd>A free, open source, cross-platform, graphical web browser developed by the Mozilla Corporation and hundreds of volunteers.</dd>
? <dd>The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long).</dd>
</dl>
- 1 回答
- 0 關(guān)注
- 122 瀏覽
添加回答
舉報(bào)