I have element with clip-path (hexagon) on it pseudo(:before
and :after
).
.cssload-cssload-spinner {
position: relative;
border: none;
}
.cssload-cssload-spinner:before,
.cssload-cssload-spinner:after {
display: block;
content: ' ';
width: 88px;
height: 88px;
border: none;
outline: none;
clip-path: polygon(50% 0, 7% 26%, 7% 74%, 50% 100%, 93% 74%, 93% 26%, 83% 32%, 83% 69%, 50% 89%, 17% 69%, 17% 32%, 50% 12%, 83% 32%, 93% 26%);
}
Pseudo elements animated with css-animation. And I see starange border after adding animation.
It cannot be removed with border: none
or outline: none
(I have no ideas anymore).
How I can remove that borders?
Example:
.cssload-wrap {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
display: -o-flex;
display: -ms-flex;
display: -webkit-flex;
display: -moz-flex;
box-pack: center;
-o-box-pack: center;
-ms-box-pack: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-o-justify-content: center;
-ms-justify-content: center;
-webkit-justify-content: center;
-moz-justify-content: center;
box-align: center;
-o-box-align: center;
-ms-box-align: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-o-align-items: center;
-ms-align-items: center;
-webkit-align-items: center;
-moz-align-items: center;
perspective: 390px;
-o-perspective: 390px;
-ms-perspective: 390px;
-webkit-perspective: 390px;
-moz-perspective: 390px;
height: 100vh;
overflow: hidden;
}
.cssload-cssload-spinner {
position: relative;
border: none;
transform-style: preserve-3d;
-o-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
animation: cssload-wobble 4.59s ease-in-out infinite;
-o-animation: cssload-wobble 4.59s ease-in-out infinite;
-ms-animation: cssload-wobble 4.59s ease-in-out infinite;
-webkit-animation: cssload-wobble 4.59s ease-in-out infinite;
-moz-animation: cssload-wobble 4.59s ease-in-out infinite;
}
.cssload-cssload-spinner:before,
.cssload-cssload-spinner:after {
display: block;
content: ' ';
border: none;
width: 88px;
height: 88px;
outline: none;
-webkit-clip-path: polygon(50% 0, 7% 26%, 7% 74%, 50% 100%, 93% 74%, 93% 26%, 83% 32%, 83% 69%, 50% 89%, 17% 69%, 17% 32%, 50% 12%, 83% 32%, 93% 26%);
clip-path: polygon(50% 0, 7% 26%, 7% 74%, 50% 100%, 93% 74%, 93% 26%, 83% 32%, 83% 69%, 50% 89%, 17% 69%, 17% 32%, 50% 12%, 83% 32%, 93% 26%);
animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-o-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-ms-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-webkit-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-moz-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
}
.cssload-cssload-spinner:before {
background-color: #02baff;
position: absolute;
}
.cssload-cssload-spinner:after {
background-color: #4c4c4c;
animation-delay: -0.86s;
-o-animation-delay: -0.86s;
-ms-animation-delay: -0.86s;
-webkit-animation-delay: -0.86s;
-moz-animation-delay: -0.86s;
}
@keyframes cssload-wobble {
0%,
100% {
-webkit-transform: rotateX(8.75deg) rotateY(35deg);
transform: rotateX(8.75deg) rotateY(35deg);
}
50% {
-webkit-transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
}
}
@-webkit-keyframes cssload-wobble {
0%,
100% {
-webkit-transform: rotateX(8.75deg) rotateY(35deg);
}
50% {
-webkit-transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
}
}
@keyframes cssload-spin {
0%,
100% {
-webkit-transform: translateZ(49px) rotateX(14deg);
transform: translateZ(49px) rotateX(14deg);
}
33% {
-webkit-transform: translateZ(-49px) scale(0.4);
transform: translateZ(-49px) scale(0.4);
}
66% {
-webkit-transform: translateZ(-49px);
transform: translateZ(-49px);
}
}
@-webkit-keyframes cssload-spin {
0%,
100% {
-webkit-transform: translateZ(49px) rotateX(14deg);
}
33% {
-webkit-transform: translateZ(-49px) scale(0.4);
}
66% {
-webkit-transform: translateZ(-49px);
}
}
<div class="cssload-wrap">
<div class="cssload-cssload-spinner"></div>
</div>
Works only in chrome http://codepen.io/sattellite/pen/RrZpBB
Update: example already haven't this strange borders. Solved by Joseph Marikle
.cssload-wrap {
display: flex;
display: -o-flex;
display: -ms-flex;
display: -webkit-flex;
display: -moz-flex;
box-pack: center;
-o-box-pack: center;
-ms-box-pack: center;
-webkit-box-pack: center;
-moz-box-pack: center;
justify-content: center;
-o-justify-content: center;
-ms-justify-content: center;
-webkit-justify-content: center;
-moz-justify-content: center;
box-align: center;
-o-box-align: center;
-ms-box-align: center;
-webkit-box-align: center;
-moz-box-align: center;
align-items: center;
-o-align-items: center;
-ms-align-items: center;
-webkit-align-items: center;
-moz-align-items: center;
perspective: 390px;
-o-perspective: 390px;
-ms-perspective: 390px;
-webkit-perspective: 390px;
-moz-perspective: 390px;
height: 100vh;
overflow: hidden;
}
.cssload-cssload-spinner {
position: relative;
transform-style: preserve-3d;
-o-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
animation: cssload-wobble 4.59s ease-in-out infinite;
-o-animation: cssload-wobble 4.59s ease-in-out infinite;
-ms-animation: cssload-wobble 4.59s ease-in-out infinite;
-webkit-animation: cssload-wobble 4.59s ease-in-out infinite;
-moz-animation: cssload-wobble 4.59s ease-in-out infinite;
}
.cssload-cssload-spinner:before,
.cssload-cssload-spinner:after {
display: block;
content: ' ';
border-radius: 50%;
width: 88px;
height: 88px;
-webkit-clip-path: polygon(50% 0, 7% 26%, 7% 74%, 50% 100%, 93% 74%, 93% 26%, 83% 32%, 83% 69%, 50% 89%, 17% 69%, 17% 32%, 50% 12%, 83% 32%, 93% 26%);
clip-path: polygon(50% 0, 7% 26%, 7% 74%, 50% 100%, 93% 74%, 93% 26%, 83% 32%, 83% 69%, 50% 89%, 17% 69%, 17% 32%, 50% 12%, 83% 32%, 93% 26%);
animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-o-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-ms-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-webkit-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
-moz-animation: cssload-spin 1.73s ease-in-out infinite both reverse;
}
.cssload-cssload-spinner:before {
background-color: #02baff;
position: absolute;
}
.cssload-cssload-spinner:after {
background-color: #4c4c4c;
animation-delay: -0.86s;
-o-animation-delay: -0.86s;
-ms-animation-delay: -0.86s;
-webkit-animation-delay: -0.86s;
-moz-animation-delay: -0.86s;
}
@keyframes cssload-wobble {
0%,
100% {
transform: rotateX(8.75deg) rotateY(35deg);
}
50% {
transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
}
}
@-o-keyframes cssload-wobble {
0%,
100% {
-o-transform: rotateX(8.75deg) rotateY(35deg);
}
50% {
-o-transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
}
}
@-ms-keyframes cssload-wobble {
0%,
100% {
-ms-transform: rotateX(8.75deg) rotateY(35deg);
}
50% {
-ms-transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
}
}
@-webkit-keyframes cssload-wobble {
0%,
100% {
-webkit-transform: rotateX(8.75deg) rotateY(35deg);
}
50% {
-webkit-transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
}
}
@-moz-keyframes cssload-wobble {
0%,
100% {
-moz-transform: rotateX(8.75deg) rotateY(35deg);
}
50% {
-moz-transform: rotateX(35deg) rotateY(-35deg) rotate(180deg);
}
}
@keyframes cssload-spin {
0%,
100% {
transform: translateZ(49px) rotateX(14deg);
}
33% {
transform: translateZ(-49px) scale(0.4);
}
66% {
transform: translateZ(-49px);
}
}
@-o-keyframes cssload-spin {
0%,
100% {
-o-transform: translateZ(49px) rotateX(14deg);
}
33% {
-o-transform: translateZ(-49px) scale(0.4);
}
66% {
-o-transform: translateZ(-49px);
}
}
@-ms-keyframes cssload-spin {
0%,
100% {
-ms-transform: translateZ(49px) rotateX(14deg);
}
33% {
-ms-transform: translateZ(-49px) scale(0.4);
}
66% {
-ms-transform: translateZ(-49px);
}
}
@-webkit-keyframes cssload-spin {
0%,
100% {
-webkit-transform: translateZ(49px) rotateX(14deg);
}
33% {
-webkit-transform: translateZ(-49px) scale(0.4);
}
66% {
-webkit-transform: translateZ(-49px);
}
}
@-moz-keyframes cssload-spin {
0%,
100% {
-moz-transform: translateZ(49px) rotateX(14deg);
}
33% {
-moz-transform: translateZ(-49px) scale(0.4);
}
66% {
-moz-transform: translateZ(-49px);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With