0

I can't get rid of the white space above the Visualforce page that is embedded on my page layout. The Visualforce markup has conditional rendering depending on the user's display theme. The whitespace is only showing in Lightning, not in Classic (see screenshots).

<apex:outputPanel rendered="{! !isClassic}">
    <apex:slds />
</apex:outputPanel>
<div class="slds-scope">

<apex:outputPanel rendered="{!isClassic}">
    <div style="font-size: 10;padding-left: 38%">
    Director's Time
    </div>

</apex:outputPanel>

<apex:outputPanel rendered="{! !isClassic}">
    <div class="slds-grid slds-m-top_none">
    Director's Time
    </div>

</apex:outputPanel>    

</div>
</apex:page>

Classic Lightning

  • Hard to tell what whitespace you are talking about here – Eric Aug 24 '17 at 16:38
0

I would restructure your page a bit to get rid of extra divs, may or may not solve your issue....

<apex:outputPanel rendered="{!isClassic}">
    <div style="font-size: 10;padding-left: 38%">
    Director's Time
    </div>

</apex:outputPanel>

<apex:outputPanel rendered="{! !isClassic}" layout="block" styleClass="slds-scoped">
    <apex:slds />
    <div class="slds-grid slds-m-top_none">
    Director's Time
    </div>

</apex:outputPanel>    

</apex:page> 
  • Tried this, but got no formatting, just Times New Roman. Tried switching the output panels so the Lightning markup appears first and added slds-scope to the div above Director's Time. Still seeing the white space above Director's Time text. – Jean Grey Aug 24 '17 at 17:25
  • What is the markup for the stuff above it? I guess the slds has to be before the scoped div – Eric Aug 24 '17 at 17:27
  • Yes the first thing on the page after apex:page should be an output panel with nothing in it except <apex:slds />. This is according to documentation from Salesforce. trailhead.salesforce.com/projects/… – Jean Grey Aug 24 '17 at 17:30
  • @KristyAnn - Still need to see the markup for the stuff above it. Did you use the console to inspect the generated markup to see what class/styles were adding the margin/padding – Eric Aug 24 '17 at 17:38
  • I don't have markup for the rest of the page, it's just the standard detail page. – Jean Grey Aug 24 '17 at 18:16

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.