When my email doesn’t validate I want to add the red border from the class focus and an X mark from the pseudo-element before. The code shows the red border but it doesn’t show the X mark. How do I add the pseudo-element to my text box?
The :before pseudo-class adds some content into the element, before any other children. Input elements don’t have children though – and they don’t actually have a closing tag. If you want to add an X with a pseudo class, you’ll have to add it to a sibling like you’ve done it with the label.