Monday, January 27, 2014

How to add the Document Header in Visualforce page

How to add the Document Header in Visualforce page

Directly there is no way to add the document type in visualforce. However in most of the cases IE9 does not work with Visualforce pleasantly. And then we need to add the Document type in header. So following workaround will work.
<apex:outputText
escape="false"
value="{!'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">'}"/>
<html>
    <head>
        <title>test</title>
    </head>
    <body>test</body>
</html>
</apex:page>

Read more in detail in thread – http://boards.developerforce.com/t5/Visualforce-Development/Changing-doctype-of-a-Visualforce-Page/td-p/82397/page/2


No comments:

Post a Comment