html - What sort of markup do you recommend for a table of contents? -


I need to create a large table of contents for an HTML book, but I can not decide that its markup What is the best solution for? I have two options: definition list or order list.

Would you consider it a personal style decision? And how about cementics?

I like to count my list but I have problems using "ol" with the nestes list. I think I had to manually numbered with my definition lists (and to disable the style in my list).

I thought about these two:

Option A:

  & lt; Div class = "TOC" & gt; & Lt; DL & gt; & Lt; Dt & gt; & Lt; A href = "#" & gt; Introduction & lt; / A & gt; & Lt; / Dt & gt; & Lt; DT & gt; I & Lt; A href = "#" & gt; Chapter 1 & lt; / A & gt; & Lt; / Dt & gt; & Lt; Dd & gt; & Lt; DL & gt; & Lt; Dt & gt; 1 & lt; A href = "#" & gt; Section 1 & lt; / A & gt; & Lt; / Dt & gt; & Lt; Dd & gt; & Lt; DL & gt; & Lt; Dt & gt; 1.1 & lt; A href = "#" & gt; Sub section A & lt; / A & gt; & Lt; / Dt & gt; & Lt; Dt & gt; 1.2 & lt; A href = "#" & gt; Sub section B & lt; / A & gt; & Lt; / Dt & gt; & Lt; Dt & gt; 1.3 & lt; A href = "#" & gt; Sub Section C & lt; / A & gt; & Lt; / Dt & gt; & Lt; / DL & gt; & Lt; Dt & gt; 2 & lt; A href = "#" & gt; Section 2 & lt; / A & gt; & Lt; / Dt & gt; & Lt; / Dd> & Lt; / DL & gt; & Lt; / Dd> & Lt; / DL & gt; & Lt; / Div & gt;  

Option B:

  & lt; Div class = "TOC" & gt; & Lt; Ol & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Introduction & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Chapter 1 & lt; / A & gt; & Lt; Ol & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Section 1 & lt; / A & gt; & Lt; Ol & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Subsection A & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Sub section B & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Subdivision C & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ol & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Section 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ol & gt; & Lt; / Li & gt; & Lt; / Ol & gt; & Lt; / Div & gt; The definition list is not strictly for "definitions" because some people are saying - if they were, they would have very few uses, however, while  & lt; Dl / & gt;  s is very flexible and has many uses, so the ordering looks like a better option. 

If you number nested lists (whether nested & lt; ol / & gt; s or & lt; dl / & gt; s) If you have CSS per-pay increase and counters - instead of maintaining numbering manually for each modification, reset properties to add numbers based on nested depth.

Example:

  .TOC Ol {List-style-type: None; Reply-To: toc1; } .OC OL Lee :: First {content: counter (toc1) ''; Counter-pay increase: toc1; } .OC Olli Hole {Counter Reset: Tosi 2; } .OC Olli Lee Lee :: First {content: counter (toc1) '.' Counter (toc2) ''; Counter-pay increase: TOC2; } .OC Oll Lee Ol Lee Hole {Counter Reset: Tosi 3; } .OC Oll Lee El Lee Lee Lee :: Before {Content: Counter (toc1) '.' Counter (Tosi 2) '.' Counter (toc3) ''; Counter-pay increase: toc3; }  

Comments