5

I have a visual force page which uses pageblock tag:

<apex:pageblock title="Sample"> </apex:pageblock> 

I would like to make the background color of title="Sample" as green. How can I add styles to the pageblock tag. I tried tabstyle but seems like it does not serve the purpose.

1 Answer 1

8

I don't see a Salesforce supported way of doing this. But for a little bit hacking into this you can use the below css code which is working for me:

body .bPageBlock .pbHeader { background-color: Green; } 

You don't need to add an class or attributes in your html for using this.

2
  • Thanks. What if I don't have a html tag in my code. Is it still doable? Any Hack for that? Commented Jun 1, 2016 at 5:00
  • Sorry , I tried and it worked with out <html> tags. THanks Commented Jun 1, 2016 at 5:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.