+ Start a Discussion
krishnagkrishnag 

image as a commandbutton

hi 

i used a  image for a command button,It s working fine but the problem is when i mouseover the image i am not getting the hand symbol its just giving the pointer symbol.how can i make the hand symbol come on.

 

 

<apex:commandButton id="cbtneditlogin" action="{!editprofile}" style="bgcolor:white;background-image:url({!URLFOR($Resource.preferimages,'images/login.jpg')});height:35px;width:155px;border-width:0px;background-repeat:no-repeat;"/>

 

 

Best Answer chosen by Admin (Salesforce Developers) 
krishnagkrishnag

solved the problem need to add attribute cursor:pointer in the style attribute.

<apex:commandButton id="cbtneditlogin" action="{!editprofile}" style="bgcolor:white;background-image:url({!URLFOR($Resource.preferimages,'images/login.jpg')});height:35px;width:155px;border-width:0px;background-repeat:no-repeat;cursor:pointer;"/>

 

 

All Answers

krishnagkrishnag

solved the problem need to add attribute cursor:pointer in the style attribute.

<apex:commandButton id="cbtneditlogin" action="{!editprofile}" style="bgcolor:white;background-image:url({!URLFOR($Resource.preferimages,'images/login.jpg')});height:35px;width:155px;border-width:0px;background-repeat:no-repeat;cursor:pointer;"/>

 

 

This was selected as the best answer
Bhavesh Jha 33Bhavesh Jha 33
thanks krishang, it really helped me :)