css - Spinning an image using rotateY -
css - Spinning an image using rotateY -
i'd spin image , came across video https://www.youtube.com/watch?v=nd8xqlh6esk gave simple way spin div on click. thought great method spin image on page load minimal css tried using :after opposed :click (with 720 deg) didn't work. has got approach work on page load rather on click? i've seen other methods need quite bit more css.
detail provided
[apparently youtube link football game match although me it's levelup tuts css experiments #1 - card flipping effect video.]
basically, flips card through simple transform on hover follows:
<div class="card"></div> .card { background: blue; width: 200px; height: 200px; } .card:hover { transform: rotatey (90deg); }
so can spin div single line, transform, on hover. there's no need keyframes.
try this:
class="snippet-code-css lang-css prettyprint-override">div { width: 100px; height: 100px; background: red; animation: spin 2s infinite; -webkit-animation: spin 2s infinite; } @keyframes spin{ to{ transform: rotate(360deg); } } @-webkit-keyframes spin{ to{ transform: rotate(360deg); }
class="snippet-code-html lang-html prettyprint-override"><div id="d"></div>
edit: more wanted? class="snippet-code-css lang-css prettyprint-override">div { width: 100px; height: 100px; background: red; animation: spin 2s forwards; -webkit-animation: spin 2s forwards; } @keyframes spin{ to{ transform: rotatey(90deg); } } @-webkit-keyframes spin{ to{ transform: rotatey(90deg); } }
class="snippet-code-html lang-html prettyprint-override"><div id="d"><img src="http://img4.wikia.nocookie.net/__cb20120208185721/logopedia/images/5/54/barclays_premier_league_logo_(shield).gif" width="100px" height="100px"></div>
css css-transitions
Comments
Post a Comment