function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pu 7pu 7 

VF page Showing Different view on site.com

Hi All,

I facing an issue with my VF page in which I have used slds for styling. When I tried to preview the page from VF page it shows fine but when using same VF page on site and tried to preview it as admin it shows diffrent styling.

<apex:page  showheader="false" sidebar="false"  standardStylesheets="false" applyHtmlTag="false" lightningStyleSheets="true" applyBodyTag="false" docType="html-5.0" id="leadcaptureform" >
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
        <head>
            <apex:slds />
        </head>
        
        <body>
            <apex:image id="theImage1" value="{!$Resource.Test}" width="150" height="40" alt="abc" style=""/>
            <div class="slds-scope">
                <div class="slds-page-header" style="background-color:green;">
                    <div class="slds-align_absolute-center" style="background-color:green;height:60px;">
                        <apex:image id="theImage" value="{!$Resource.Test}" width="150" height="40" alt="ttt" style=""/>
                    </div>
                </div>      
            </div>
        </body>
    </html> 
</apex:page>


User-added image
Although It must show as per below screenshot.

User-added imageSame scenario when I implemented in my dev org it is working fine and showing page fine on site as well but in sandbox it is not behaving as expected.

Please suggest anything which I'm missing. Thanks in advance.
Raj VakatiRaj Vakati
Looks like you are styles are not loading or working in  Sites  .. 

use the lightning design system styles as a static resource and try 
Durai SaravananDurai Saravanan
Hi,

First set, lightningStyleSheets="false"

And then, align the image as required, by referring to visualforce page.

Now, when you see in your site, it will render perfectly.

Hope this helps you.
Please mark this as 'Best Answer' if my reply was helpful. It will make it available for other as the proper solution.

Best regards,
Durairaj Saravanan

 
pu 7pu 7
Hi Raj,

I tried to use static resource but still it is working as it is, no change. 

Please suggest me any other thing to resolve it.

Regards,
Puneet