0

Is is possible to specify DOCTYPE in Salesforce visual force components? How can DOCTYPE affect the responsiveness of the component (If we have given some styling/responsiveness to the UI)

Any suggestions would be helpful!

2
  • did you try or read the documentation? Please limit your posts to only 1 question as mentioned in How to Ask Thanks
    – glls
    Jun 26, 2017 at 19:21
  • You can only add that attribute to pages.
    – Adrian Larson
    Jun 26, 2017 at 19:26

1 Answer 1

2

HTML only allows a single DOCTYPE for a page. Accordingly, you cannot specify a DOCTYPE for a single element. DOCTYPE will generally have little effect on performance, but may cause other complications. For example, if you use an XHTML DOCTYPE, you'll be forced to verify all your code is perfectly XHTML compliant or the entire page will fail to load. Generally speaking, you should use either no DOCTYPE (for HTML4), or HTML5. Other types tend to be quirky and may cause undesirable graphical glitches or parsing errors.

2
  • thanks ! So, If I have some problem viewing the responsiveness of the component in a mobile, can this be solved using a doctype ? Because, as we cannot use this in visual force component what can be the solution for this? Jun 27, 2017 at 4:07
  • @kkbandi No, changing the DOCTYPE won't likely fix anything. If a component isn't responsive, it's likely a CSS problem.
    – sfdcfox
    Jun 27, 2017 at 4:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .