WordPress.org

Ready to get started?Download WordPress

Forums

Ordered list LI atributes (2 posts)

  1. JonasVorwerk
    Member
    Posted 3 years ago #

    We all know how to style our fine blogs with css but once in a while people want special things. Now I've got somebody who wants numbered lists in the content. No problem, just add them. But, how to start the list with another number and not 1. Well add value="3" in the LI tag.

    The problem is, WordPress reformats this everytime and removes the value attribute. Is the a nice clean way to do this?

  2. Hax
    Member
    Posted 3 years ago #

    stylessheet

    ul {
      counter-reset: list-order 3;
      list-style-type: none;
    }
    ul li { counter-increment: list-order; }
    ul li:before  { content: counters(list-order, ".") ". "; }

    you reset your count every time you need to start a new list only bad thing old browsers don't support this feature and on firefox the tags need to be list tags

    you can read more here http://dev.opera.com/articles/view/automatic-numbering-with-css-counters/

Topic Closed

This topic has been closed to new replies.

About this Topic