Can I see a context?
Are you using a custom:button-card
inside some Picture elements card?
If so, the conditional positioning should be done like it is described here:
- type: 'custom:button-card'
card_mod:
style:
{% if is_state(..., 'Lighting') %}
--my-top: 215px;
--my-left: 270px;
{% elif is_state(..., 'Home') %}
--my-top: 175px;
--my-left: 175px;
{% else %}
--my-top: 500px;
--my-left: 500px;
{% endif %}
entity: input_select.page
style:
left: var(--my-left)
top: var(--my-top)
Not tested by myself, try using this.