我目前正在尝试嵌套几个有序列表html标记,并将它们作为单独的类型。但是,所有列表元素都保留为类型1,我无法说明原因。
这是我的代码:
<ol type="1">
<li>Sales Associate 2003- Present</li>
<ol type="2">
<li>Target West, Wichita, KS</li>
<ol type="3">
<li>Help customers with purchases</li>
<li>Handle customer questions and complaints, working to ensure complete customer satisfaction</li>
<li>Run cash register</li>
<li>Monitor security system</li>
</ol>
</ol>
<li>Grounds Keeper 1998-2003</li>
<ol type="2">
<li>Riverside Golf Course, Wichita, KS</li>
<ol type="3">
<li>Helped with the general outdoor maintenance of the apartment complex</li>
<li>Worked as a member of a team</li>
<li>Scheduled maintenance repairs with tenants as needed</li>
</ol>
</ol>
</ol>
答案 0 :(得分:1)
您不能将ol
作为另一个ol
的直接子项,它必须嵌套在li
中。
<ol type="1">
<li>Sales Associate 2003- Present
<ol type="2">
<li>Target West, Wichita, KS
<ol type="3">
<li>Help customers with purchases</li>
<li>Handle customer questions and complaints, working to ensure complete customer satisfaction</li>
<li>Run cash register</li>
<li>Monitor security system</li>
</ol>
</li>
</ol>
</li>
....
</ol>
此外type
2和3不是有效的属性值。
有效的属性是:
1
代表十进制数字(例如1. 2. 3. ...等)a
代表小写拉丁字母(例如a.b.c. ...等)A
代表大写拉丁字母(例如A. B. C.等等)i
代表小写罗马数字(例如,i。ii。iii。......等)I
代表大写罗马数字(例如I. II.III ....等)答案 1 :(得分:0)
您必须将新列表包装成li
元素,如下所示:
<li> Text
<ol>
<li>...</li>
</ol>
</li>