arriff
arriff

Reputation: 439

How to adjust list style Background Image position angular?

Is there a way to adjust the position of list-style background-image?

When I use padding for list items the image will stay stuck at the top at its position and won't move with padding.

<li class="list-list-item" [ngStyle]="{'background-image' : (reports.response_rate_7day_change > 0) ? getIncrease():  getDecrease() }" style="background-repeat: no-repeat;  padding: 3px 0px 3px 10px; list-style: none; margin: 0; vertical-align: middle;">
</li>

enter image description here

Upvotes: 0

Views: 82

Answers (1)

Remy
Remy

Reputation: 868

Just add this to your style

background-position: center;

the complete implementation will be

<li class="list-list-item" [ngStyle]="{'background-image' : (reports.response_rate_7day_change > 0) ? getIncrease():  getDecrease() }" style="background-repeat: no-repeat; background-position: center;  padding: 3px 0px 3px 10px; list-style: none; margin: 0; vertical-align: middle;">
</li>

Upvotes: 1

Related Questions