Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Magdalena Misiuna
Magdalena Misiuna
14,873 Points

custom ordered list: [1] [2] [3] ...

Is there a way to create custom ordered list starting with this format: [1], [2], [3], ... ?

Steven Parker
Steven Parker
231,269 Points

With CSS? Are you sure you placed this question in the right category?

Steven Parker ,

I think the question is relating to CSS list-style-types but it does look like it could be a JavaScript multidimensional array question.

1 Answer

Magdalena Misiuna ,

I don't this is best achieved with CSS (but my css is pretty rusty). There are a set list of values with the list-type-type property.

You can see a list of the values here: https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type#Values

You could use try styling your css list items with the following:

    /* Target all list item elements and add square braces: [ 1. ] */
    li:before {
      content: '[ \00a0 \00a0 \00a0 ]';
      margin-left: -28px;
      margin-right: 10px;
    }

I think JavaScript would be better suited to achieving this than pure css.