【问题标题】:SCSS wont compile - Animation delaySCSS 无法编译 - 动画延迟
【发布时间】:2014-03-13 04:15:35
【问题描述】:

我正在尝试逐步增加所有 i 元素的动画延迟,但我似乎无法使语法正确。我晚上采取了正确的方法还是应该使用 js?干杯

http://codepen.io/2ne/pen/ycIpj

@for $i from 1 through 10 {
  &:nth-child(#{$i}) {
    animation-delay: (#{$i * 0.1})s; 
  }
}

【问题讨论】:

    标签: jquery css sass


    【解决方案1】:

    你应该把&改成li,看下面的代码:

    @for $i from 1 through 10 {
      li:nth-child(#{$i}) {
        animation-delay:(#{$i*0.1s}); 
      }
    }
    

    对于这样的标记:

    <li></li>
    <li></li>
    ...
    

    “基础级规则不能包含父选择器引用字符'&'。”

    【讨论】:

    • 似乎分开工作形式我在动画延迟数和's'值之间有一个空格
    • 我通过将 s 放在封闭括号内来修复它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多