我有一个div
如下:
<div class="circle-icon"><span class="icon icon-loanaccount"></span></div>
此div
标记具有以下样式:
.circle-icon {
background: #db552d none repeat scroll 0 0;
width: 50px;
&::after{
border-bottom: 5px solid #db552d;
content: "";
height: 0;
position: absolute;
}&:before{
border-bottom: 5px solid #db552d;
content: "";
height: 0;
}
}
如何使用angular动态调整border-bottom
样式,假设我想要在scope.borderColor
中使用我想要的颜色?
答案 0 :(得分:3)
ng-style
是您的朋友,请点击此处working link。
$scope.bordercolor = "thick dotted #ff0000";
<div class="circle-icon" ng-style ="{'border-bottom': bordercolor}">
<span class="icon icon-loanaccount"></span>
</div>