On a fairly regular basis, I’ll run across a page on one of the sites I manage that’s gone sideways- usually due to someone making an edit to the content that inadvertently broke the HTML markup.
Or, I’ll have a page that I need to modify, but the markup is so poorly formed that it’s impossible to make heads or tails of it.
So what do you do? Pore over the source view to find the problem, or copy/paste it into Notepad and do the necessary cleanup manually?
Thankfully, there are tools to do that for you – my go to is HTML Tidy, a free open source program that will clean up unruly code for you.
You can download it at http://tidy.sourceforge.net, or use the online tool at http://infohound.net/tidy/. You point it to the offending URL (or copy/paste in the source), and it will scour the code, note any errors or poorly formed markup, then spit out a cleaned up, easy-to-read version. Saves time and your sanity.