##### 30.11.2.3 Converting nested lists

If you used nested lists in your DITA document, you must assign the following properties to inner list formats:

[HTMLParaStyles]
; LNest specifies a style that nests in an enclosing list
; LLevel specifies the nesting level to use, 1-30

Make each level a different list type

HTML does not let you nest a list inside another of the same type. If you have a bulleted list with a bulleted sublist, change the bulleted style for the sublist; for example, if the top-level list is List6, make the sublist style List7. Also make the top-level list LLevel1, and make the sublist both LNest and LLevel2. You can nest quite deeply and still retain the structure, if you apply these properties correctly.

Suppose your DITA document has one numbered list nested inside another. You would assign LLevel1 to the outer list format, and LLevel2 to the inner (nested) list format. You would also assign the LNest property to the nested format, and, if you use a different format for the first item, assign LFirst to the first-item format in both lists. For example:

[HTMLParaStyles]
Numbered1 = List1 LLevel1 LFirst
Numbered = List1 LLevel1
AlphaSub1 = List4 LLevel2 LFirst LNest
AlphaSub = List4 LLevel2 LNest

If you are using CSS, you might want to add, in the CSS file:

ol ol {list-style-position: outside}

This is how to specify properties for nested lists in CSS.

If you are not using CSS, and your document has nested lists, you might need this setting:

[CSS]
; AlwaysNestLists = No (default, no nesting when CSS used) or Yes
AlwaysNestLists = Yes

However, if you use CSS at all for list items, you will get a mess if the lists really do nest. DITA2Go prevents that by default (with AlwaysNestLists=No), when you use class attributes. Setting AlwaysNestLists=Yes turns off this safety net, so you will have to adjust the CSS for the nested items to prevent overindenting. And also wave goodbye to cross-browser consistency.

Previous Topic: 30.11.2.2 Converting lists with multiple paragraph formats

Next Topic: 30.11.2.4 Converting dictionary lists

Parent Topic: 30.11.2 Converting list formats to HTML list styles

Sibling Topics:

30.11.2.1 Specifying HTML list styles (deprecated)

30.11.2.2 Converting lists with multiple paragraph formats

30.11.2.4 Converting dictionary lists

30.11.2.5 Omitting CSS class attributes from list entries

30.11.2.6 Including or excluding the type list attribute

Table of Contents • Index