0

I am trying to add a background image to a tab in my salesforce Account tab. Below is the code that i am using. Active should give me an url to image that looks like this.

enter image description here

Which should be the background image of the tab inside the Account tab.

Please advise,

Darko

<apex:page standardController="Account" showHeader="true" 
      tabStyle="account" >
   <style>
      .activeTab {background-color: #236FBD; color:white; width: 170px; height: 40px; padding-top: 25px; font-size: 16px; font-style: bold; border: 0px;
         background-image:url(/servlet/servlet.FileDownload?file=01520000002Z3Ly);}
      .inactiveTab { background-color: lightgrey; color:black; width: 170px; height: 40px; padding-top: 25px; font-size: 16px; font-style: bold; border: 0px;
         background-image: none}
   </style>
      <apex:pageBlock title="Hello {!Account.Contacted_by__c}!" mode="edit" >
        You are displaying values from the {!account.name} account and a separate contact
        that is specified by a query string parameter.
    </apex:pageBlock>
   <apex:tabPanel switchType="client" selectedTab="tabdetails" 
                  id="AccountTabPanel" tabClass="activeTab" 
                  inactiveTabClass="inactiveTab">   
      <apex:tab label="Details" name="AccDetails" id="tabdetails" style="background-color: white; ">
         <apex:detail relatedList="false" title="true"/>
      </apex:tab>
      <apex:tab label="Contacts" name="Contacts" id="tabContact" >
         <apex:relatedList subject="{!account}" list="contacts"  />
      </apex:tab>
      <apex:tab label="Opportunities" name="Opportunities" 
                id="tabOpp">
         <apex:relatedList subject="{!account}" 
                           list="opportunities" />
      </apex:tab>
      <apex:tab label="Open Activities" name="OpenActivities" 
                id="tabOpenAct">
         <apex:relatedList subject="{!account}" 
                           list="OpenActivities" />
      </apex:tab>
      <apex:tab label="Activity History" name="ActivityHistory" id="tabActHist">
          <apex:relatedList subject="{!account}" list="ActivityHistories" />
      </apex:tab>
      <apex:tab label="Notes & Attachments" 
                name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!account}" 
                           list="CombinedAttachments" />
      </apex:tab>
   </apex:tabPanel>

</apex:page>
1

Remove the semi-colon at the end of background-image: url as below in the first line just below <Style> and see if that doesn't solve your problem.

.activeTab {background-color: #236FBD; color:white; width: 170px; height: 40px; 
  padding-top: 25px; font-size: 16px; font-style: bold; border: 0px;
  background-image:url(/servlet/servlet.FileDownload?file=01520000002Z3Ly)}
| improve this answer | |

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.