Is it possible to use JS to automatically and continuously change a particular CSS property?
I want to create glowing border whose glow continuously brightens and dampens (using 3 properties to achieve this effect - border, box shadow, inset box shadow). How can I do so?
Please note that I am not talking about using "hover" or "active" states. Also I want it to work in all browsers, if possible.
In this tutorial, you'll find some methods of creating a glowing border around an input field with CSS properties. In the example below, we add the :focus pseudo-class to the <input> element and then, specify the border-color and box-shadow properties. Also, we set the outline property to “none”.
CSS border animation is useful for giving a border image or container element a unique style. To make a website's user interface (UI) more attractive, use a CSS border animation design. CSS border animation is useful for giving a border image or container element a unique style.
Manipulating the above answer for CSS only solution
@-webkit-keyframes glow {
to {
border-color: #69c800;
-webkit-box-shadow: 0 0 5px #69c800;
-moz-box-shadow: 0 0 5px #69c800;
box-shadow: 0 0 5px #69c800;
}
}
.myGlower {
background-color: #ccc;
border: 1px solid transparent;
-webkit-animation: glow 1.0s infinite alternate;
-webkit-transition: border 1.0s linear, box-shadow 1.0s linear;
-moz-transition: border 1.0s linear, box-shadow 1.0s linear;
transition: border 1.0s linear, box-shadow 1.0s linear;
width: 100px;
height: 100px;
margin: 50px;
}
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