ngstyle
snippet in html

ngstyle

user9490

<div [ngStyle]="{'background-color':person.country === 'UK' ? 'green' : 'red' }"></<div>

ngStyle

user4191

[ngStyle]="{'background-image': 'url(' + data.headerImage + ')'}"

ngstyle

user7890

      
        content_copy
      
      <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>