gpt4 book ai didi

html - Angular 设置动态样式在 Chrome 中不起作用

转载 作者:行者123 更新时间:2023-11-28 07:02:12 26 4
gpt4 key购买 nike

我想让div的高度逐步增加20px,为什么下面的代码只能在Chrome中使用而在IE中不能使用?

<div ng-repeat="p in percentage">
<div style="height: {{$index*20+5}}px"></div>
</div>

最佳答案

使用 ng-style="height: {{$index*20+5}}px"

改成

<div ng-repeat="p in percentage"> <div ng-style="height: {{$index*20+5}}px"></div>

引用AngularJS expression not working within style attribute on IE8

关于html - Angular 设置动态样式在 Chrome 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33165355/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com