How to add inline styles like style="width:.." in shortcodes?

Hi, I want to get <img … style=“width:30%”> in shortcodes, for example, I got a varialbe $width. then how to write the code about style in shortcodes?

{{< img style=$width }} ----?


Should be written more like:

<img style="{{ $width }}">

Thanks, < img style=“width:{{ $width }}”> works

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.