Will HTML 5 validation be worth the candle?

前端 未结 6 760
青春惊慌失措
青春惊慌失措 2020-12-08 07:14

It\'s widely considered that the best reason to validate one\'s HTML is to ensure that all browsers will treat it consistently and predictably.

The HTML 5 draft, h

6条回答
  •  粉色の甜心
    2020-12-08 08:12

    It's a good question.

    The primary purpose of validation (for me at least) is to help me catch errors in my markup, and to give me a good base on which to build when testing pages in different browsers; if the markup is valid, and the page is borked in IE6, it's an IE6 issue.

    The fact that browsers should all still behave in a predictable manner even if your markup includes technically invalid HTML5 such as a table summary, or an anchor accesskey, muddies the waters somewhat.

    As a general rule of thumb, I'd always want my pages to validate, for the aforementioned reason. However, if (for example) an attribute was dropped from the HTML5 spec without an apparently suitable replacement being added, I might be inclined to continue using the deprecated or obsolete attribute, and accept the validation errors.

    As ever, I think it's a case of knowing your craft.

    If you know what you're doing, and have made a conscious decision to build a page that doesn't validate for sound reasons, it's not a problem. If you're just writing code that doesn't validate because you don't know any better, that's another matter entirely.

    Stephen

提交回复
热议问题