My requirement is to show the account detail page in red color based on the value of a picklist field in account object. How can i do that?

I know that we can override a the detail page and apply styles. But my doubt is how can i apply styles only if picklist value shows some "XYZ".

Thank you

  • If you want to do it right way you need to override a standard page. Otherwise it will be a hack :) Oct 1, 2013 at 13:18

4 Answers 4


Instead of turning the entire detail screen red, consider using an image formula to show a "Stoplight" graphic on the detail screen. See the following thread for more info: https://success.salesforce.com/answers?id=90630000000h2trAAA


It's unusually difficult to try and modify the standard style sheets, especially since they tend to change every few releases and are dependent upon the current theme being used. Given that any effort you put into this today may not work for much longer than a year (and I'm probably being generous), you should probably just skip this idea and post an idea on the IdeaExchange.


What you could do is use jquery to modify the styles of the generated html of the standard account page.

You can create a homepage component (html area - narrow) in that component you can click on the showHtml checkbox and there you can add the javascript you need to change the colour of the div tags.

After your result is like you want you could then hide the homepage component so its not visible to a user but it would still work.

$( document ).ready(function() {

but like mast0r mentions it is a hack...


You might have more luck utilizing a tool like this:


to generate visualforce pages out of your standard detail page. Once you've got a custom visualforce page you can add an extension that can pull in the field you're looking for from the account and alter the css of your custom page accordingly.

downside: you loose the drag/drop layout editor.

You must log in to answer this question.

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