Jump to content
Sign in to follow this  
harinezumi

css3, I want to add :after at input:focus:invalid but doesn't work

Recommended Posts

Hallo, I'm trying to add a unicode HEAVY CHECK MARK ✔ and HEAVY BALLOT X ✘ to the input:focus:valid and input:focus:invalid respectively.I don't want to use a background-image as in many samples I found online.So I tried:

input:focus:invalid:after,  textarea:focus:invalid:after {content:"\2716";}input:focus:valid:after, textarea:focus:valid:after {content:"\2714";}

I also tried content:"X" and content:"OK" in case the problem was unicode.But this doesn't produce any result. Any idea?My documents are HTML5 and CSS.Thank you

Share this post


Link to post
Share on other sites

:valid and :invalid are not CSS selectors as far as I know. That's probably your problem. You probably mean .valid and .invalid preceded by . and not :

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...