0

I'm having trouble displaying content before input element.

http://plnkr.co/edit/9UC93nnNm6vmmLEIYDJK?p=preview

On this plunker you can see input:before should display something, but it's not displaying anything

1) If I change it to p:before it displays content before p, but without incremented value, what should I change there?

2) Why it doesn't display values for input:before?

[EDIT after Daniels's and dTDesign's answers/comments]

@dTDesign

I changed it to p, it adds content now and with combination of @Daniel's answer (I changed .main to main) I got displaying content in front of paragraphs with correct incrementing.

so you can use main within HTML5.

Update:

It works fine now:

arserbin3
  • 6,010
  • 8
  • 36
  • 52
Slaven Tomac
  • 1,552
  • 2
  • 26
  • 38
  • For your question #2 take a look to the answer in this question http://stackoverflow.com/questions/4574912/css-content-generation-before-input-elements – Michael Schmidt Nov 08 '13 at 12:58
  • You should be posting comments down here instead of putting your replies in an edit. – BoltClock Nov 08 '13 at 15:41
  • For user with reputation below 10 I had to wait 8 hours to reply on my own issue. I think it's better for people to get answers right away, don't you? – Slaven Tomac Nov 08 '13 at 15:51

1 Answers1

1

For your first question, you need to put counter-reset: input_counter; in a parent element (for example the body) to initiate it. Right now you try to do this on .main, but from what I can see, such element doesn't exist (you do have a tag named main, but that's an entirely different thing).

Edit: Sorry, I'm obviously not accustomed enough with HTML5. <main> is very much an accepted tag in HTML5. :)

Daniel Perván
  • 1,685
  • 13
  • 11
  • 1
    Ah, I missed that I used class in CSS, I've changed that, BUT isn't main HTML5 element? And, when I change it in css to main, it still doesn't help – Slaven Tomac Nov 08 '13 at 13:19