function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anthony PicaAnthony Pica 

<style> inside <head>

The <style> block is supposed to go inside the <head> but when you add it to a Visualforce page, it gets placed outside of the <head>.

How can we get <style> to go inside <head>?

sfdcfoxsfdcfox

You have two choices:

 

1) Override the HTML tag completely (showHeader, applyBodyTag, and applyHtmlTag all set to false); this will let you generate your own code from scratch. You also won't get anything over than a blank page, all standard styling will be gone.

 

2) Use apex:stylesheet. This requires an external stylesheet, so you'll have to upload it either as a separate page or as a static resource (pages are easier to edit, but static resources are technically the correct way to do so). Any such style sheets will be applied after all of the standard style sheets, making it possible to override the parts of the standard UI without the use of !important.

Mohith Kumar ShrivastavaMohith Kumar Shrivastava

One thing you need to consider that there are few new tags in salesforce for Apex:page innversion 28 where you have ability to switch of automatic generation of html and head tags in rendered html.