2

The ":after" selector is not working when applied to an input with FF and IE

input:after {
    content: "title";        
}​

whereas it's working with p, a, etc.

Is it a bug?

jsFiddle

  • Pseudo-elements, in my experience, tend to be difficult (or perhaps impossible) to implement for `img` and `input` elements. Perhaps due to the fact that those elements are rendered by the OS (`input`) or 'replaced-elements' (I forget the correct term) in the case of the `img`. – David Thomas May 30 '12 at 22:20

1 Answers1

0

Nope is not a bug, :after/:before don't work consistently (and properly) on self closing elements, as David Thomas said. The cause is that unlike an other elements, you can't nest tags inside inputs or imgs, unlike a or span tags.

Read on at CSS content generation before or after 'input' elements.

Community
  • 1
  • 1
leopic
  • 2,958
  • 2
  • 27
  • 42