A few years ago, we slowly started adding ads to our main site. Proud of the work I’d done in the design and layout, I was furious when these new ads caused my carefully designed pages not to validate. I dug around the web for years trying to find out why and how to fix this, and today, I learned how.
Elliott Back’s 10 Steps to Valid HTML explains that the ads start out with an ampersand looking like this:
&. The browser changes it to
&. The ampersand breaks validation – so to fix it, just change it back. This can be work, but if you are determined to have valid HTML/XHTML, then a quick search and replace will fix this.
Here is an example. This is the before look of a section of some ad code:
and here is the after:
There is plenty of other good information in his article about how to overcome the most common HTML/XHTML validation errors, so make sure you bookmark this.