Toronto Mike

I Feel So Validated

W3C Validated

The World Wide Web Consortium specifies the standards for HTML 4.01.  Their MarkUp Validation Service will actually check your HTML code for conformance to W3C Recommendations and other standards.  As a hand-coder who takes pride in the tidiness of his HTML and CSS, I wanted my code to be validated.  Don't we all?

In order to validate your HTML, you must define a DOCTYPE.  I added this code to the very top of my page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">. I then added the appropriate character set to my meta tags: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">. Ready for validation, I submitted my pages and learned my HTML code did comply with the standards for HTML 4.01.  All is well, right?

Wrong.  Once I added the above DOCTYPE declaration, my pages were validated but Internet Explorer began forcing a horizontal scroll bar for no reason in particular.  I went through my HTML code character by character but there was nothing that would force a horizontal scroll bar.  It seems Microsoft is playing by their own rules and doesn't like me adding the DOCTYPE declaration for W3C validation.  There is no way my site can be validated by the W3C and viewed properly in IE all at once.  Isn't that ridiculous?  This is wrong!  There is clearly a choice to be made here.  Either I keep the DOCTYPE declaration that will validate my code as being compliant with HTML 4.01 specifications or I can remove it so those using Internet Explorer will see the site as it's intended to look.  What would you do?

Author image
About Toronto Mike
Toronto
I own TMDS and host Toronto MIke'd. Become a Patron.