html - HTML5:枚举而不是 ul 用于段落内的内联列表?
问题描述
考虑以下段落:
So in the first set, we start to mix those 3 codes:
- AA
- BB
- CC
with those codes:
- Aa
- Ab
- Ac
to get the perfect result we're looking for.
这一段在语义上不正确吗?如果不是,html5的写法是什么?
- 如果我使用 ul,那么它将段落分成三部分,这在语义上是不精确的(不是吗?)。
- 我可以使用 br 或 span,但是我必须自己进行所有格式化。
我们只有这两种方法吗?如果是这样,为什么不使用枚举元素,如下所示:
<p>
So in the first set, we start to mix those 3 codes:
<enum>
<ei>AA</ei>
<ei>BB</ei>
<ei>CC</ei>
</enum>
with those codes:
<enum>
<ei>Aa</ei>
<ei>Ab</ei>
<ei>Ac</ei>
</enum>
to get the perfect result we're looking for.
</p>
这有什么意义吗?
我想向 W3C 提出这个建议,你认为这是个好主意吗?
如果不是,为什么?
解决方案
我认为使用描述列表是上述特定示例的最佳方式,例如;
<dl>
<dt>So in the first set, we start to mix those 3 codes:</dt>
<dd>AA</dd>
<dd>BB</dd>
<dd>CC</dd>
<dt>with those codes:</dt>
<dd>Aa</dd>
<dd>Ab</dd>
<dd>Ac</dd>
</dl>
推荐阅读
- python - 何用 python-docx 读取单个表格单元格使用的列数(colspan)
- c - 如何垂直打印数据?
- ansible - 根据条件在ansible中传递Shell命令
- c# - 如何将 JSON 以下转换为 C# POCO 对象
- angular - 将新选项卡动态添加到 mat-tab-group
- python - 在 Django 中迁移时删除应用程序默认值
- angular - 我应该如何对 contenteditable div 进行双向绑定,以便我们可以在 onclick 事件发生时访问内容并进行更改?
- java - 在控制台中打印 TypedQuery
- android - 将 Android Studio Gradle 从 4.0.2 更新到 4.1.0 时出错
- spring-boot - 如何将 Cloud Foundry 中的用户提供的变量调用到 SpringBoot 应用程序