1
ol:before {
  counter-increment: section;
  content: "Article " counter(section) ". ";
 }

How do i add a class to content:? if thats not possible a style will also do

Since you're inserting content, i want them to hide. If i remove the whole line it will not count

Currently it shows up like this:

Article 1: Terms of Condition

Article 1:
1.1 lorem ipsum
1.2 lorem ipsum
1.3 lorem ipsum

The 2nd "Article 1" should hide

1
  • Note that i dont want to add "terms of condition" just at the end of the line, because for other articles it would show up the same name Commented Nov 14, 2014 at 10:24

1 Answer 1

1

Add a class to the ol element instead:

<ol class="... before-class">

Then style the :before pseudo-element using that:

ol.before-class:before {
    display: none;
}
Sign up to request clarification or add additional context in comments.

1 Comment

visibility: hidden worked better for me, not sure why but it works now. Thanks James

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.