I've been using the validator.w3.org service for my XHTML Transitional webpages and have been very happy with it - it shows me incorrect syntax and unclosed tags easily.
However, we're coding our new site in HTML5 - so the Doctype naturally becomes . The w3 validator therefore validates the page as HTML5. I've used this for some time but only just realised that it does not notify me of un-closed tags. For example, if I use
<div><p>This is my text and I am not closing this P tag</div>
then a XHTML validator will notify me of the above problem, but validation on HTML5 does not show me that the above is a problem. Is there any way I can resolve this?
Additionally, I've freely been using code like the following, which shows the following error if validated as XHTML, but does not have any problems if validated as HTML(5) :
Line 266, Column 51: document type does not allow element "h5" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
<a href="/outlet/" title="" rel='nofollow'><h5>OUTLET</h5></a>
I thought the above (to use an H5 inside an A element) is OK on HTML5, but after realising that HTML is not validated as XHTML, I'm quite confused! If I want to build a web page to "good standards" - what standard do I follow? I definitely want to make use of HTML5, but I want to also ensure that my code has the correct closing tags (as in the above P tag example) and also follows any other "good standards". Please advise what you would do?
Many thanks