【发布时间】:2020-04-24 08:05:40
【问题描述】:
我遇到了以下问题:我想使用 ngStyle 将背景图片插入我的网站。以下代码工作正常:
<div [ngStyle]="{'background-image': 'url(' + myBackgroundUrl + ')', 'width': '224px', 'height': '248px'}"></div>
但是,如果我想为背景图像添加更多“属性”,则图像不再可见:
<div [ngStyle]="{'background-image': 'url(' + myBackgroundUrl + ') no-repeat -228px 0', 'width': '224px', 'height': '248px'}"></div>
【问题讨论】:
标签: angular background ng-style