css - Animate color change? -
i've never used css animations before on next project. have this:
but rather having color change i'd fill left right in same way progress bar does. possible border color?
.box{ position : relative; width : 200px; height : 50px; background-color : black; color:white; border-bottom: 5px solid grey; -webkit-transition : border 500ms ease-out; -moz-transition : border 500ms ease-out; -o-transition : border 500ms ease-out; } .box:hover{ border-bottom: 5px solid red; }
you can adapt answer fill background color left right css:
#box{ position : relative; top: 10px; left: 10px; width : 100px; height : 100px; background-color : gray; } #simulate_border { position : relative; width : 120px; height : 120px; background: linear-gradient(to right, red 50%, black 50%); background-size: 200% 100%; background-position:right bottom; transition:all 500ms ease; } #simulate_border:hover{ background-position:left bottom; }
diagonal progression possible - jsfiddle2
Comments
Post a Comment