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
sfdc18sfdc18 

How to make image as link in visualforce?

An image should  appear as link and it should redirect to another visualforce page.

How can I achieve this?

Best Answer chosen by Admin (Salesforce Developers) 
neophyteneophyte

<a href="/apex/vfpage"><apex:image id="theImage" value="{!$Resource.myResourceImage}" /></a>

 

This will work.

All Answers

neophyteneophyte

<a href="/apex/vfpage"><apex:image id="theImage" value="{!$Resource.myResourceImage}" /></a>

 

This will work.

This was selected as the best answer
APathakAPathak

Or going with the standard visualforce tag,

 

<apex:outputLink value="https://www.salesforce.com" id="theLink">

     <apex:image url = "imageurl">

      </apex:image>

</apex:outputLink>

Nikhil DevNikhil Dev

<apex:page >
<apex:form >
<apex:outputLink value="https://c.ap1.visual.force.com" >
<apex:image url="https://ap1.salesforce.com/resource/13485470/Logo"/ >
</apex:outputLink>
</apex:form>
</apex:page>