Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to have nested number lists in Confluence

David Csikkel June 29, 2019

Hello, 

I have found recommended solution:

  1. Go to the space that you would like this numbering be implemented on
  2. Go to Space Tools > Look and Feel > Stylesheet
  3. Edit > copy and paste the following code > Save
ol {
    counter-reset: item;
}
ol li {
    display: block;
    position: relative;
}
ol li:before {
    content: counters(item, ".")".";
    counter-increment: item;
    position: absolute;
    margin-right: 100%;
    right: 10px; /* space between number and text */
}

It works but... very big BUT... it breaks confluence pages on many places:

1) broken breadcrumbs navigation

Snímek obrazovky 2019-06-29 v 11.33.45.png

2) broken comments

Snímek obrazovky 2019-06-29 v 11.36.15.png

 

Can you propose any solution for default behavior (not based on writing special macro for nested number list)?

 

Thanx a lot in advance for any suggestions

David csikkel

 

 

 

 

 

1 answer

1 vote
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2019

I think the issue is that you CSS rules apply to all nested lists, which can impact a lot of menu items. You need to restrict your CSS to apply only to your content, which inside a container with class .wiki-content.

So for example, your rules should be:

.wiki-content ol {
    counter-reset: item;
}
.wiki-content ol li {
    display: block;
    position: relative;
}
.wiki-content ol li:before {
    content: counters(item, ".")".";
    counter-increment: item;
    position: absolute;
    margin-right: 100%;
    right: 10px; /* space between number and text */
}

You may have to play with the selectors a bit (like .wiki-content ol > li), maybe make the rule for li without the ol, for example:

.wiki-content li {
    display: block;
    position: relative;
}

The point is to make the CSS more focused.

David Csikkel June 29, 2019

Thank you... 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events