我有下面的 html 和 css,我需要将 .tooltip:after 设置为 {{ item.color }},就像我使用 ngstyle 为静态类设置的一样。
<div class="tooltip" ng-style="{ 'background' : item.color}" ng-class="{ 'after': border-top: solid item.color 10px;}"</div></a>
.time-of-year .tooltip:before {
bottom: -22px;
content: " ";
display: block;
height: 20px;
left: 85px;
position: absolute;
border-color: #a9a9a9 transparent transparent transparent;
border-style: solid;
border-width: 11px;
}
/* Yellow triangle */
.time-of-year .tooltip:after {
border-left: solid transparent 10px;
border-right: solid transparent 10px;
border-top: solid #fff 10px;
bottom: -10px;
content: " ";
height: 0;
left: 99px;
margin-left: -13px;
position: absolute;
width: 0;
}