Search code examples
xhtml-1.0-strictxhtml

What happens when a XHTML DOCTYPE doesn't validate?


Life is good, using XHTML Strict with much success

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

...Then, bam! You toss a Vimeo video onto your page that breaks validation.

<iframe src="http://player.vimeo.com/video/XXXXX?byline=0&amp;portrait=0" width="468" height="351" frameborder="0"></iframe>

No iframes allowed, sir!

So, what impact does it have on the way the page renders, or impact on the visitor? Why care about the validation of this iframe?


Solution

  • It doesn't have an impact on the page itself. Unless you are worried about validation, I would stay with the transitional doctype:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    

    The iframe validation is solely up to you. Here is a list of elements that compare with each doctype.