8

By default, SFDC pages (including Visualforce) are served with the DOCTYPE for HTML 4.01 Transitional (!!!) -- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

According the the VF documentation, we can serve VF pages as any doctype we want, including HTML5:

The HTML document type definition (DTD), or doctype, that describes the structure of the rendered page. If not specified, this value defaults to "html-4.01-transitional", which results in a doctype of . Possible values for this attribute include "html-4.01-strict", "xhtml-1.0-transitional", "xhtml-1.1-basic", and "html-5.0", among others. For more information about HTML doctype declarations, see the W3C specifications. -- Documentation for apex:page docType attribute

I'd love to develop my Visualforce in HTML5, but we're using a lot of standard Salesforce styling and formatting. Does the SFDC styling perform well under HTML5? Are there bugs, errors, or strange behaviors you've noticed?

1

I haven't noticed anything amiss when using the HTML5 doctype. The whole reason was chosen in the first place is because it was the simplest doctype that would be rendered by browsers in standards mode. This means that html4 markup will display fine under html5. This does not mean that all will be rosy trying to get visualforce to play nicely with html5, as one of the links in your comments illustrate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.