0

I am new to salesforce development. I want to display an image in LWC in salesforce. I added the image in static resource and add the line in lightning component

<img src="{Resource.Img1}" />

The image is showing in the LWC but when I add width and height to the image it disappears. How can I add width and height and how I can add css in LWC.

Hasan Zubairi
  • 1,037
  • 4
  • 23
  • 57
  • Hi. Can you share how are you adding the width and height to the image (the exact code that you are using)? – Óscar Gómez Balaguer Oct 24 '21 at 20:26
  • I got this. I added a inline style to the img tag and it worked. But I am unable to add – Hasan Zubairi Oct 24 '21 at 21:25
  • – Óscar Gómez Balaguer Oct 25 '21 at 19:33

1 Answers1

0

You can add inline css as below and update the height and width of your image according to your requirement.

Dharman
  • 30,962
  • 25
  • 85
  • 135