Web Developers continue to argue whether it’s really that important to validate every website using the “Strict DOCTYPE”, or if valid website markup code is really even that important. While this is a discussion for another time, I try to publish every site I author in valid, Strict xHTML. I believe standards are made for a reason, and if you wish to write good code – just follow the standards.
Occasionally I find the need for a page element that is not considered valid xHTML-Strict markup. One big one that has come up is the good ole’ “iFrame” tag. Granted you can always change the DOCTYPE to “Transitional” and still have valid code, or you can use the “Object” tag to get the same results and be valid. In the past I’ve done both of these, but I’d rather use the Strict DOCTYPE and let’s face it; “Object” tags simply do not play nice across browsers.
Also, sometimes you want to embed xHTML strict iFrame Vimeo videos, or Amazon iFrames that are SEO-friendly. I’m sure there are other ways to display this sort of external web content (ajax, CURL), but I’ve yet to find any useful when building simple pages. Regardless, I found what I think is a MUCH better solution to including iFrame content, both technically speaking and considering Search Engine Optimization (SEO; search bots don’t like iFrames).
Note: This outline is designed for people with at least a little to moderate web design and developing experience. Also, this technique is a workaround that is Search Engine friendly for use when iFrame content is inevitable. It should be noted that iFrames are not valid elements for a reason and should be filtered out if possible. While this will allow your pages to “validate”, it’s really just tricking the browser.