Lovelace - setting picture size by style is not working

i’m using the following entity and trying to configure its absolute size with the “style” property:

        - type: picture
          image: /local/init.png
          style:
            width: 50px
            height: 50px
          tap_action:
            action: call-service
            service: mqtt.publish
            service_data:
              topic: home/gamescornerneon/setmode
              payload: RESET

tried also setting width and height with percentage but the image size is never changed and its big - i want to make it much smaller.

how do i do this?

image

It looks like you meant to use the Picture Elements Card but omitted the -elements portion (the Picture Card doesn’t support style).

eg:

        - type: picture-elements
          image: /local/init.png
          style:
            width: 50px
            height: 50px
          tap_action:
            action: call-service
            service: mqtt.publish
            service_data:
              topic: home/gamescornerneon/setmode
              payload: RESET
1 Like

i wasn’t aware of this element - seems like exactly what i was looking for - thx!

1 Like

Oh I figured that’s where you got the style syntax.

I love the Picture Elements Card. I’m slowly converting almost all of my cards to it.