Validating your web site helps the search engine crawl it and helps get you a better page rank. If your markup is confusing to the crawler, it might give up entirely or at least miss things. While I was working on this theme here at Templatesagogo, I discovered the footer in the forum page was misaligned and a quick check of the php files showed everything appeared OK with align and clear things.
This left me to fire up the validator. Woops! 20 something errors. Some errors are because the validator looks at the world through a very narrow eye and what is written is actually OK. Other, more severe errors affect rendering of the page, which is the problem I had. Since the errors were the result of some JS in the head, a /div that I didn’t remove when I created the single column page for the forum and some random /li and /ul tags, I started with the easy one first.
I looked at the JS text in the head. It is for the buttons in the sidebar. Since I don’t like JS anyway, my first impulse was to remove it and see if it would work anyway. I checked the site functionality to see how it works with the JS then removed the offending text to see about the after. Just as I thought, no difference. This is in FF v3.0+ but not tested in other browsers.
That brought the error count down to about eight. To troubleshoot the /div issue, I had to do some typing. I annotated the single column php files with comment tags (view source to see) so I knew which opening tags belonged to which closing tags. The extra /div stuck out. I now needed to verify that the tag really didn’t belong there. I annotated the original two column php file and there was no extra /div tag. I removed the tag and the errors went down to two.
I still had the /li and /ul errors. These were around the back button functionality I added. (See registered users page for code). I moved the code up a little and rechecked. It worked fine and validated with zero errors. I had inadvertently put the code in a place outside of the unordered list. Like most errors, it was my own sloppy work that caused the error.
You have to remember, the validator is black and white, right or wrong. Close is wrong, only perfect is right.



