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
    Commented Mar 31, 2017 at 7:23
  • Ideally you should use your own HTML and CSS instead of using standard visualforce component and then overriding the CSS.
    – Raul
    Commented Mar 31, 2017 at 7:24

1 Answer 1

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

You must log in to answer this question.

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