In the Web Developer toolbar, under Tools there are buttons to validate things including CSS and HTML. As I posted earlier, the Information > Display element info button will do this, as will several other buttons. Look at them all and play around to see what they do.

The best way to edit code and avoid errors is to use a good programming text editor. I like Notepad++ (available free from Sourceforge); it displays different kinds of elements in different colors, and highlights many kinds of errors for you. You can have a half dozen files open at the same time and work back & forth.
Since you are working locally, as soon as you save an edit you can refresh your storefront screen and see the effect.