-1

I am trying to make images flip using CSS3.

Here is an example using JS but I need a straight CSS solution

Lewis Frost
  • 557
  • 1
  • 5
  • 25
  • possible duplicate of [CSS3 Rotate Animation](http://stackoverflow.com/questions/16771225/css3-rotate-animation) – dllhell Feb 18 '15 at 12:37

2 Answers2

1

You can try this:

img{
    -webkit-transition: all 1s; /* For Safari 3.1 to 6.0 */
            transition: all 1s;
}
img:hover{
    -webkit-transform: rotate(270deg); /* Chrome, Safari, Opera */
        -ms-transform: rotate(270deg); /* IE 9 */
            transform: rotate(270deg);
}

You edited your question, from what I understand, then this is the best solution:

Example: http://embed.plnkr.co/ZaPfSa4Od9lfC9idwDGW/preview

img{
    -webkit-transition: all .5s; /* For Safari 3.1 to 6.0 */
    transition: all .5s;
}
img:hover{
    -webkit-transform: scaleX(-1);
    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    transform: scaleX(-1);

    filter: FlipH;
    -ms-filter: 'FlipH';
}
Victor Camargo
  • 374
  • 9
  • 16
-1

a more complete vendor prefixed version:

-webkit-transition: -webkit-transform 1s;
-moz-transition:    -moz-transform 1s;
-o-transition:      -o-transform 1s;
-ms-transition:     -ms-transform 1s;
transition:         transform 1s;
maioman
  • 18,154
  • 4
  • 36
  • 42