Numbered list starting at 0, how to?

Hi,

I’d like to have a numbered list starting at 0 instead of 1, so I tried to insert the following code in HTML without success, even if the result is correctly computed and displayed in the editor :

<ol start="0">
    <li> foo</li>
    <li> bar</li>
</ol>

Same result with

<li value="4"> foo

Thank you !

  • What’s your URL? This is the easiest way for others to debug your issue
    https://www.chienlit.com
  • What version of Ghost are you using?
    2.31.0
  • What configuration?
  • What browser?
    Chrome Beta

I would probably do something like: https://codepen.io/JohnONolan/pen/ExYObjB

2 Likes

It should work, but I can’t make it work. I use the code injection to insert the CSS, and the HTML in an HTML card… count still starts at 1 …

It works for me using the same code.

In Code Injection:

<style>
.custom-counter {
  margin: 0;
  padding: 0;
  list-style-type: none;
  counter-reset: step-counter -1;
}

.custom-counter li {
  counter-increment: step-counter;
  margin-bottom: 10px;
}

.custom-counter li::before {
  content: counter(step-counter);
  margin-right: 5px;
  font-size: 80%;
  background-color: rgb(0,200,200);
  color: white;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
}
</style>

HTML:

Result:

1 Like

I forgot the <style> around the CSS… that wasn’t helping :frowning:
Thank you very much !

1 Like