1

I am trying to add a moving picture banner onto my website with some basic pictures. I don't need anything fancy, just want a slideshow feel. I don't want to have to download any third party software or get crazy with my code, so I looked to this stackoverflow question to help me write my CSS:

Smooth Infinite Scrolling Banner [CSS Only]

Here is the CSS that I am using:

.container {
    width: 100%;
    overflow: hidden;
    margin: 10px auto;
    background: black;
}

.photobanner, .photobanner2 {
    height: 233px;
    width: 3550px;
    margin-bottom: 5px;
    font-size: 0;
}

.photobanner img, .photobanner2 img {
    margin-bottom: 10px;
    margin-right: 5px;
    height: 233px;
    width: 350px;
}

.photobanner img  {
    -webkit-transition: all 0.5s ease;
    -moz-transition: all 0.5s ease;
    -o-transition: all 0.5s ease;
    -ms-transition: all 0.5s ease;
    transition: all 0.5s ease;
}

.photobanner img:hover {
    -webkit-transform: scale(1.2);
    -moz-transform: scale(1.2);
    -o-transform: scale(1.2);
    -ms-transform: scale(1.2);
    transform: scale(1.2);
    cursor: pointer;

    -webkit-box-shadow: 0px 3px 5px rgba(0,0,0,0.2);
    -moz-box-shadow: 0px 3px 5px rgba(0,0,0,0.2);
    box-shadow: 0px 3px 5px rgba(0,0,0,0.2);
}
/*keyframe animations*/
.first {
    -webkit-animation: bannermove 30s linear infinite;
       -moz-animation: bannermove 30s linear infinite;
        -ms-animation: bannermove 30s linear infinite;
         -o-animation: bannermove 30s linear infinite;
           animation: bannermove 30s linear infinite;
}

@keyframes "bannermove" {
 0% {margin-left: 0px;}
 100% {margin-left: -2125px;}
}

@-moz-keyframes bannermove {
 0% {margin-left: 0px;}
 100% {margin-left: -2125px;}
}

@-webkit-keyframes "bannermove" {
 0% {margin-left: 0px;}
 100% {margin-left: -2125px;}
}

@-ms-keyframes "bannermove" {
 0% {margin-left: 0px;}
 100% {margin-left: -2125px;}
}

@-o-keyframes "bannermove" {
 0% {margin-left: 0px;}
 100% {margin-left: -2125px;}
}

The HTML is very simple

<div class="container">
    <div class="photobanner">
        <img class="first" src="images/photo_17">
        <img src="images/photo_15">
        <img src="images/photo_16">
    </div>

I am using GoDaddy to host my website. When in my .css file, it shows an error next to my @-ms-keyframes "bannermove" line. It says that there is an unknown @ rule. I am wondering if I need to include something to fix this error? Any help would be appreciated and I can go into more detail with my other files if needed.

Community
  • 1
  • 1
pyguy
  • 107
  • 1
  • 1
  • 12
  • 1
    Possible duplicate of [How to validate vendor prefixes in CSS like -webkit- and -moz-?](http://stackoverflow.com/questions/1889724/how-to-validate-vendor-prefixes-in-css-like-webkit-and-moz) – Alexander O'Mara Aug 22 '16 at 15:51
  • 5
    As for this instance specifically, AFAIK `@-ms-keyframes` never existed, so that could probably be removed. – Alexander O'Mara Aug 22 '16 at 15:52
  • 3
    AFAIK ?? Is that an acronym for something? – pyguy Aug 22 '16 at 15:57
  • 3
    AFAIK: as far as I know – Alexander O'Mara Aug 22 '16 at 15:57
  • 3
    As Alexander O'Mara mentioned, `@-ms-keyframes` doesn't exist. IE10 started supporting animations straight with regular `@keyframes`. Here's the [MDN page on @keyframes](https://developer.mozilla.org/en/docs/Web/CSS/@keyframes#Browser_Compatibility) (no `-ms-` prefix for compatibility) and the [Can I Use? page](http://caniuse.com/#search=keyframes) (IE10 fully supports `@keyframes`) – Matheus Avellar Mar 02 '17 at 23:39

1 Answers1

0

You do not need to use quotations when you make a keyframe css animation. Try removing the quotations on the word bannermove as in the following code:

@keyframes bannermove {
    0% {
        margin-left: 0px;
    }
    100% {
        margin-left: -2125px;
    }
}
@-moz-keyframes bannermove {
    0% {
        margin-left: 0px;
    }
    100% {
        margin-left: -2125px;
    }
}
@-webkit-keyframes bannermove {
    0% {
        margin-left: 0px;
    }
    100% {
        margin-left: -2125px;
    }
}
@-ms-keyframes bannermove {
    0% {
        margin-left: 0px;
    }
    100% {
        margin-left: -2125px;
    }
}
@-o-keyframes bannermove {
    0% {
        margin-left: 0px;
    }
    100% {
        margin-left: -2125px;
    }
}
Alex Cushing
  • 268
  • 1
  • 17