1

Apex Page block colour

how to change my apex page block colour (it should be like my VF page Background colour).kindly help on this.

2
  • You can try to use CSS property background-color – kurunve Mar 31 '17 at 7:23
  • Ideally you should use your own HTML and CSS instead of using standard visualforce component and then overriding the CSS. – Raul Mar 31 '17 at 7:24
5

As per best practice you should not override standard components styles. still if you want this, below code might help;

<apex:page standardController="Contact">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $(".bPageBlock").css("background-color","antiquewhite");
        $(".bPageBlock").css("border-color","antiquewhite");
    });
    </script>
    <apex:pageBlock  >
        <apex:pageBlockSection >
            HELLO
        </apex:pageBlockSection>
    </apex:pageBlock>

</apex:page>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.