I've encountered an issue while creating an HTML5 form - my CSS works perfectly in all modern browsers except for Chrome:
input:focus:required:invalid:after, textarea:focus:required:invalid:after { content: "!"; font-size: 20px; margin: -18px 0 4px 0; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75); display: block; float: right; color: #c40000; }
input:focus:required:valid:after, textarea:focus:required:valid:after { content: "\2713\0020"; font-size: 20px; margin: -18px -4px 4px 0; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75); display: block; float: right; color: #009c00; }
Although this should show an exclamation mark when the input text is invalid and a checkmark as intended, Chrome seems to have other ideas.
I've attempted to use the :before pseudo element instead following advice here, but with no success. The CSS appears in Chrome's Developer Tools Styles, yet nothing is displayed on the screen. Please refrain from suggesting alternatives like using images instead of characters, as that solution is not acceptable to me. Any other suggestions would be greatly appreciated! :)