찾다

 >  Q&A  >  본문

css3 - css @keyframe 能带小数吗

比如 10.3% 如果可以精确度是多少?

黄舟黄舟2784일 전565

모든 응답(1)나는 대답할 것이다

  • ringa_lee

    ringa_lee2017-04-17 11:16:18

    可以,但是最多只能保持2为小数点。

    @keyframes myAnimation {
        0%    { height: 100px; }
        33.3% { height: 120px; }
        66.6% { height: 140px; }
        100%  { height: 200px; }
    }
    

    When it comes to CSS it takes notice of percentages down to 2 decimal places and then stops. So you would be able to get 33.34% but not 33.3457% for use in your keyframes

    SO上的相关链接:

    Is it allowed to use any decimal value in CSS keyframe animations?

    Can you use more than a whole number with @keyframe percents?

    회신하다
    0
  • 취소회신하다