Publishing Compliant HTML and Web Markup
Yesterday my friend Keith Elder posted a poignant editorial Blog about ASP.NET web sites that were not compliant with all browsers. Keith is very justified in his argument and points us to some examples. The reality is that most web developers do not know what standards compliance is, or how to determine what is and is not compliant. Too often a business makes a conscience decision to not support any browser but Internet Explorer, which is a decision that is bad on many levels. It is one thing to dictate to employees what browser they use behind your firewall, but not on any public facing property.
This week Internet Explorer 8 release Beta 2, which folks means the ultimate release of Internet Explorer 8 is just on the horizon. The reason why this will be a huge release is that IE will finally be ‘standards compliant’ itself. Which for many naive site owners means their site will look like crap and be completely unusable. I am sure they will blame Microsoft for breaking their site, but really the issue lies in the developers and designers they hired to produce their site. This includes the neighbor kid or their youngest niece who was looking for some experience that did not really know what they were doing. But even worse it includes professionals who either do not know what they are doing or are just plain lazy about producing good markup.
The Canadian Developer Connection posted a Blog post early this morning about producing compliant sites for IE 8 and have a video interview with Pete LePage about how IE 8 is important to web developers. They also have links to some good resources to use as well.
Before I go any further, I am guilty. Yes, I have produced code that does not work in every browser. I know I still do, but I know I try not to. I try to make sure each page, form and image looks and performs according to plan in IE, FireFox, Opera (if you have not tried this browser I recommend it) and Safari. These are the four I focus on because they all have a windows version and will include almost a perfect 100% of web users. But sometimes I miss something. Just last night I noticed a drop shadow effect was not rendering correctly on a site in FireFox, and you can bet I will work on that today.
Producing standards compliant code is like any other exercise, once you get used to using it, integrate the better code into your code generation templates and normal routines you will not think about it much. It could be a simple and including a closing ‘/’ in your <img> elements. I bet you will actually learn things that you can do with elements you were not aware of as well. Ultimately you will not only make content that works across all browsers, but you will find yourself making better sites too.
A good free resource to use is the W3C Markup Validation Service. You can go to this page, enter a URL to your site and it will tell you what does not comply on that page. I tried a URL of mine this morning and came up with 250 issues. Most were benign (many of my images did not have the closing ‘/’ for example, but I will also address them today as well. You can also upload a file or paste in a snippet of code for evaluation.
There is also a CSS, RSS, Mobile, and broken link validator available on the site. They also have a page of tools that can also be used for specification validation.
So as you go forward with your web development, please be conscience of HTML and CSS compliance. Your image is riding on it.