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
suji srinivasansuji srinivasan 

how to insert logo in vfpage?

Hi, i created a static resource to attach my logo in salesforce.then i copied the url and inserted in vf page .
i used the following code
<img src="https://ayush--recruitmen--c.visualforce.com/resource/1659528741000/ayushLogo?" style="width:250px;height:50px;" />.
My logo is not visible .it showing like this in preview . can anyone tell me why it is not visible. the image which i attached was jpeg format.
User-added image
thanks in advance
Best Answer chosen by suji srinivasan
mukesh guptamukesh gupta
Hi Suji,


Please follow below concepts
apex:image A graphic image, rendered with the HTML <img> tag.
Example
<apex:image id="theImage" value="/img/myimage.gif" width="220" height="55"/>
The example above renders the following HTML:
<img id="theImage" src="/img/myimage.gif" width="220" height="55"/>
Resource Example
<apex:image id="theImage" value="{!$Resource.myResourceImage}" width="200" height="200"/>
The example above renders the following HTML:
<img id="theImage" src="<generatedId>/myResourceImage" width="200" height="200"/>
Zip Resource Example
<apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" width="50" height="50" />
The example above renders the following HTML:
<id="theImage" src="[generatedId]/images/Bluehills.jpg" width="50" height="50"/>


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

All Answers

AnkaiahAnkaiah (Salesforce Developers) 
Hi Suji,

try below.
<div class="header">
    <center><img src="{!$Resource.ayushLogo}" width="25%"/></center>
</div>
If this helps, Please mark it as best answer.

Thanks!!
 
mukesh guptamukesh gupta
Hi Suji,


Please follow below concepts
apex:image A graphic image, rendered with the HTML <img> tag.
Example
<apex:image id="theImage" value="/img/myimage.gif" width="220" height="55"/>
The example above renders the following HTML:
<img id="theImage" src="/img/myimage.gif" width="220" height="55"/>
Resource Example
<apex:image id="theImage" value="{!$Resource.myResourceImage}" width="200" height="200"/>
The example above renders the following HTML:
<img id="theImage" src="<generatedId>/myResourceImage" width="200" height="200"/>
Zip Resource Example
<apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" width="50" height="50" />
The example above renders the following HTML:
<id="theImage" src="[generatedId]/images/Bluehills.jpg" width="50" height="50"/>


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
This was selected as the best answer