salesforcesalesforce-chattersalesforce-communitiessalesforce-lightning

Sizing the image inside rich text field


I have in my Salesforce"Account" object a rich text field to save images. When I tried to set its size I'm not able to do that. But if I add text content within it the styling is working perfectly with my text content. Only my image is not responding to the style given for it. I have given my code below.Can anyone figure out what's wrong with the code?

 <html> 
 <head> 
 <style type="text/css"> 
 myDiv 
 { 
  border:0px; 
  height:50px; 
  width:10px; 
 } 
 </style> 
 </head> 
 <body> 
 <div id="myDiv">Picture {!Picture__c}</div> 
 </body>
 </html>

Thanks Aruna V


Solution

  • It's not possible to resize an image with CSS so go for alternate methods. For an working method refer here.