1 回答

TA貢獻1810條經驗 獲得超4個贊
<dd>
是的,a包含 a是有效的<ul>
。根據HTML 規范,<dd>
元素應該包含流內容。無序列表被視為流內容。
但是,如果示例中的每個項目都是前面術語的替代描述<dt>
,則不應將它們標記在無序列表中,而應使用一系列<dd>
元素進行標記。
例如,以下內容是有效的 HTML,但在語義上不正確- 因為它意味著整個列表是該術語的單一描述。
<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>
標記此內容的有效且語義正確的方法是:
<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 關注
- 115 瀏覽
添加回答
舉報