CSS border animation not working on object -


on website, creating object that had border animation on it. had searched question lot of times on stack overflow , google, no solution worked. animation animated border:

.object-color {     -webkit-animation: color 1.5s linear infinite alternate both;          animation: color 1.5s linear infinite alternate both; }  @-webkit-keyframes color{   14.3% {     color: red;     background-color: #e0ffff !important;     padding-right: 5px !important;     border: 1px solid green !important;   }   28.6% {     color: green;     background-color: #e0ffff !important;     padding-right: 5px !important;     border: 1px solid red !important;   }   100% {     color: green;     background-color: #e0ffff !important;     padding-right: 5px !important;     border: 1px solid red !important;   } } 

however, when applied, border didn't animate , had no color. great, thanks!

the problem use of !important inside of keyframes. removing !important declarations cause animation work:

.object-color {    -webkit-animation: color 1.5s linear infinite alternate both;    animation: color 1.5s linear infinite alternate both;  }    @-webkit-keyframes color {    14.3% {      color: red;      background-color: #e0ffff;      padding-right: 5px;      border: 1px solid green;    }    28.6% {      color: green;      background-color: #e0ffff;      padding-right: 5px;      border: 1px solid red;    }    100% {      color: green;      background-color: #e0ffff;      padding-right: 5px;      border: 1px solid red;    }  }
<div class="object-color">hi</div>

hope helps! :)


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -