This question already has an answer here:
- Can I use a :before or :after pseudo-element on an input field? 20 answers
I am trying to design a form without using JavaScript or JQuery. It includes a series of checkboxes. The idea is to display a certain gif after the checkbox if it is unchecked. Otherwise, display nothing after it. This is the code I have:
input[type=checkbox]::after
{
content: url(images/unchecked_after.gif);
position:relative;
left:15px;
z-index:100;
}
input[type=checkbox]:checked::after
{
content:"";
}
It works in Chrome but doesn't seem to be working in Firefox or IE. What is wrong?