css - Can I use the :after pseudo-element on an input field? -


i trying use :after css pseudo-element on input field, not work. if use span, works ok.

<style type="text/css"> .mystyle:after {content:url(smiley.gif);} .mystyle {color:red;} </style> 

this works (puts smiley after "buu!" , before "some more")

<span class="mystyle">buuu!</span>a more 

this not work - colors somevalue in red, there no smiley.

<input class="mystyle" type="text" value="somevalue"> 

what doing wrong? should use pseudo-selector?

note: cannot add span around input, because being generated third-party control.

:after , :before not supported in internet explorer 7 , under, on elements.

it's not meant used on replaced elements such form elements (inputs) , image elements.

in other words it's impossible pure css.

however if using jquery can use

$(".mystyle").after("add smiley here"); 

api docs on .after

to append content javascript. work across browsers.


Comments

  1. This page contains the necessary information about game. From here I am get some information.Have
    you played the famous akinator unblocked
    ? If not, you must play it today only as it is a quite amazing game which will give you some fun moments playing it in your busy day schedule

    ReplyDelete
  2. This page contains the necessary information The Samsung Galaxy M52 is going to be published very soon if you feel free you can visit my site Samsung M52 Release Date

    ReplyDelete

Post a Comment

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -