Search code examples
cssjsfiddle

In JSfiddle how come it doesn't like @keyframes in my css?


Here is my fiddle: https://jsfiddle.net/PinG1/vyqmpL3f/19/

@keyframes example {
  0% {opacity: 0;}
  50% {opacity: 100;}
  100% {opacity: 0;}

As you can see JS fiddle does not like @keyframes and keeps returning an error. I don't know why and am trying to figure it out.

Any ideas?


Solution

  • There is no @in the jsfiddle code. Also, there is no closing curly bracket (}).

    It should be like this:

    @keyframes example {
      0% {
        opacity: 0;
      }
    
      50% {
        opacity: 100;
      }
    
      100% {
        opacity: 0;
      }
    }