Using The :invalid CSS Pseduo Class
HTML comes with a set of standards which front-end developers must compile to in order for your HTML elements to be rendered correctly.
Luckily HTML is a very forgiving language and the browsers will do its best to display the HTML correctly even if the element is defined incorrectly. But HTML will have to guess what you intended to do so the output might look different.
The things which are commonly missed in front-end development can be missing quotes, missing closed tags or incorrect tags which the browser doesn't understand. The best way to check if your HTML is correctly is to run it through a validator.
Read more: http://www.paulund.co.uk/using-the-invalid-css-pseduo-class