admin管理员组文章数量:1435859
I want to change the width value of the li:before with a variable scope (width).
<ul>
<li ng-repeat="step in stepsList" ng-style="{li:before { 'width': width;}"
ng-class="{true: 'active'}[step.active]">
<span>{{step.stepName | uppercase}}</span>
</li>
</ul>
I'm doing this code but it's not working. help please.
I want to change the width value of the li:before with a variable scope (width).
<ul>
<li ng-repeat="step in stepsList" ng-style="{li:before { 'width': width;}"
ng-class="{true: 'active'}[step.active]">
<span>{{step.stepName | uppercase}}</span>
</li>
</ul>
I'm doing this code but it's not working. help please.
Share Improve this question asked May 20, 2015 at 14:23 user2774431user2774431 531 silver badge6 bronze badges 3-
you can't.
style
does not work with pseudo-elements. – Daniel A. White Commented May 20, 2015 at 14:25 - ngstyle uses inlinestyle so it is not possible stackoverflow./questions/14141374/… – Arun P Johny Commented May 20, 2015 at 14:25
- stackoverflow./questions/20138454/… – Daniel A. White Commented May 20, 2015 at 14:26
1 Answer
Reset to default 3Unfortunately you cannot have pseudoelements
within inline styling
. What you could do is have two sepparate CSS Classes
like
.a:before {}
.b:before {}
This way you could use ngClass to add the appropriate class to your HTML
本文标签: javascriptHow to set the css of the libefore with ngstyleStack Overflow
版权声明:本文标题:javascript - How to set the css of the li:before with ng-style - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745666548a2669321.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论