我想要動態注入一個div的背景圖像。我看到圖片獲取加載正常,但CSS不會改變,div從不會獲得背景圖像。我究竟做錯了角度不工作的css
我有以下代碼:
<style>
#container {
width:100%;
}
.left_column {
float:left;
width:37%;
height: 150px;
/*background-color: red;*/
}
.right_column {
float:right;
width: 37%;
height: 150px;
}
.snipe{
float: right;
background-color: red;
color: white;
position: relative;
margin-top: 99%;
}
</style>
<div ng-app="myApp">
<div ng-controller="ShowCtrl">
<div class="content-padded">
<h2>{{zucrew.name}}</h2>
</div>
<div class="topcoat-list__item" hm-tap="open(person.id)"
ng-repeat="person in persons" ng-class-odd="'left_column'" ng-class-even="'right_column'"
ng-style="{'background-image' : 'url({{person.src}})'}">
{{ person.name }}
</div>
</div>
</div>
賓果!像魅力一樣工作 – Autolycus