It looks cool, but I want to be able to center the glowing div in the table cell. I set it to center, but it doesn’t respond. Any suggestions?
css:
/*// Glow Border Animation //*/
.animated-border-box, .animated-border-box-glow{
position: absolute;
overflow: hidden;
z-index: 0;
/* Border Radius */
border-radius: 10px;
}
.animated-border-box-glow{
overflow: hidden;
/* Glow Blur */
filter: blur(20px);
}
.animated-border-box:before, .animated-border-box-glow:before {
content: '';
z-index: -2;
text-align: center;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(0deg);
position: absolute;
width: 99999px;
height: 99999px;
background-repeat: no-repeat;
background-position: 0 0;
/*border color, change middle color*/
background-image: conic-gradient(rgba(0,0,0,0), #1976ed, rgba(0,0,0,0) 25%);
/* change speed here */
animation: rotate 4s linear infinite;
}
.animated-border-box:after {
content: '';
position: absolute;
z-index: -1;
/* border width */
left: 5px;
top: 5px;
/* double the px from the border width left */
width: calc(100% - 10px);
height: calc(100% - 10px);
/*bg color*/
background: #292a2e;
/*box border radius*/
border-radius: 7px;
}
@keyframes rotate {
100% {
transform: translate(-50%, -50%) rotate(1turn);
}
}
.center-box{
justify-content: center;
align-items: center;
}
body {
background-color: #000;
color: #fff;
}
html:
<table style="width:100%;">
<tr>
<td style="width:33%;" align="center">asdf
</td>
<td style="width:34%;" align="center">asdf
<div class="center-box">
<!-- START Box -->
<div class="animated-border-box-glow" style="width:110px;height:110px;"></div>
<div class="animated-border-box" style="width:100px;height:100px;">
<!-- Inside the Box -->
</div>
<!-- END -->
</div>
</td>
<td style="width:33%;" align="center">asdf
</td>
</tr>
</table>
I’ve tried changing the positions to relative, but my efforts aren’t working… originally the center-box class in the css code had display: flex;
but I removed that and seemed to make some progress…