向多个定义列表添加标题?
Adding a title to more than one definition list?
我希望有多个定义列表并为这些列表设置一个标题,例如:
//how can I add the title of "Items in fridge"
<dl>
<dt>Food:</dt>
<dd>Eggs</dd>
<dd>Bacon</dd>
</dl>
<dl>
<dt>Drinks:</dt>
<dd>Water</dd>
<dd>Juice</dd>
</dl>
将整体 <dt>
添加到各种定义列表的正确方法是什么
不能 100% 确定我是否正确理解了问题,但也许可以将它们放在 <section>
?
中
<section>
<h1>Items in Fridge</h1>
<dl>
<dt>Food:</dt>
<dd>Eggs</dd>
<dd>Bacon</dd>
</dl>
<dl>
<dt>Drinks:</dt>
<dd>Water</dd>
<dd>Juice</dd>
</dl>
</section>
(注意:我的 post 最初有另一个解决方案,但正如 Alohci 在评论中指出的那样,它无效 HTML)
我希望有多个定义列表并为这些列表设置一个标题,例如:
//how can I add the title of "Items in fridge"
<dl>
<dt>Food:</dt>
<dd>Eggs</dd>
<dd>Bacon</dd>
</dl>
<dl>
<dt>Drinks:</dt>
<dd>Water</dd>
<dd>Juice</dd>
</dl>
将整体 <dt>
添加到各种定义列表的正确方法是什么
不能 100% 确定我是否正确理解了问题,但也许可以将它们放在 <section>
?
<section>
<h1>Items in Fridge</h1>
<dl>
<dt>Food:</dt>
<dd>Eggs</dd>
<dd>Bacon</dd>
</dl>
<dl>
<dt>Drinks:</dt>
<dd>Water</dd>
<dd>Juice</dd>
</dl>
</section>
(注意:我的 post 最初有另一个解决方案,但正如 Alohci 在评论中指出的那样,它无效 HTML)