I'm having trouble incorporating the :after
CSS pseudo-element on an input
field. It seems to be working fine with a span
, but not with the input field.
<style type="text/css">
.mystyle:after {content:url(smiley.gif);}
.mystyle {color:red;}
</style>
The following code snippet works as expected (places the smiley face after "buu!" and before "some more"):
<span class="mystyle">buuu!</span>a some more
However, the next code snippet does not work - it only changes the color of "someValue" to red without displaying the smiley face:
<input class="mystyle" type="text" value="someValue">
I'm wondering what I might be doing incorrectly. Should I be using a different pseudo-selector?
It's worth noting that I am unable to wrap my input
in a span
because it is generated by a third-party control.