Grow your CSS skills. Land your dream job.

CSS counter none and counter skip

  • # January 19, 2013 at 10:09 am

    Hi,
    I’m looking for a way to disable CSS counter. For example, I place an OL counter in my #content, but then in one specific case, I don’t want it to count anything. I can set the :before content to nothing, of course. But is there a way to just say “counter:none” ?

    2nd question.
    If I have an OL counter, and I place a UL inside the OL, it does a little wonky thing because it counts the UL items, then the OL appears to have skipped over a bunch of numbers.

    Here is a fiddle with the offensive LI marked in red: http://jsfiddle.net/rjqgz/2/
    Is there a way to exclude the UL from the OL’s counter? Skip over it?

    Thanks!

    # January 19, 2013 at 10:46 am

    Don’t wrap it in a list-item?

    # January 19, 2013 at 10:52 am

    In general yes, I’ve rearranged some of my WordPress theme so I catch one use-case and place it elsewhere, but still would like to know if there’s a way to catch the two scenarios above. For things like related search results in a 404 page, or whatnot that you might want to include.

    # January 19, 2013 at 11:36 am

    Give the LI a class and use .

    .class:before { display: none; }

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".