2016-09-22 21 views
-2

我目前試圖嵌套幾個有序的列表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> 
+1

你的HTML是無效的。您不能在另一個列表中啓動列表,它需要在列表項中。你在期待什麼類型屬性在這裏做?你的意思是起始屬性? – j08691

+0

您無法將OL作爲OL的孩子,這是無效的HTML。你需要把它放到一個列表項中。 – CBroe

回答

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表示十進制數
  • a表示小寫拉丁字母(例如1. 2. 3. ...等)(例如ABC ...等)。
  • A表示大寫拉丁字母(例如ABC ...等)
  • i表示小寫羅馬數字(例如,我。II。III。...等)
  • I代表大寫的羅馬數字(例如: I. II。 III。 ...等)
0

您必須包裝新的列表到這樣的li元素:

<li> Text 
<ol> 
    <li>...</li> 
</ol> 
</li>