2

I tried to flip an image and then rotate it using css.

This is the page

<!doctype html>
<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <title> Mounts </title>
        <style type="text/css">
            img {
                -webkit-transform: rotate(180deg);
                -webkit-transform: scaleX(-1);
            }
        </style>
    </head>
    <body>
        <img src='1.jpg'>
    </body>
</html>

But one of the transform functions was disabled by chrome.

Is it illegal to use more than one transform function ?

1
  • If you want to have different delays for these see: CSS3 transition scale but not translation (or use a keyframe animation) (using @MichaelPeterson's answer below) Commented Aug 13, 2013 at 22:59

3 Answers 3

4

You can combine them in one statement:

transform: rotate(180deg) scaleX(-1);

Or you could use the matrix property: http://www.w3schools.com/css3/css3_2dtransforms.asp

There's even generators for the code, such as: http://www.css3maker.com/css3-transform.html

Sign up to request clarification or add additional context in comments.

Comments

1

I had problems with Lea Verou's rotating sign too. It did not work without modification in webkit. This is how I solved it:

    <style>
    div {
  width: 9em;
  padding: .6em 1em;
  margin: 2em auto;
  background: yellowgreen;
  -webkit-animation-name: spin;
  -webkit-animation-duration: 1000ms;
  -webkit-animation-iteration-count: infinite;
  -webkit-animation-timing-function: linear;
  -webkit-animation-play-state: paused;
  animation: spin 1s linear infinite;
  animation-play-state: paused;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
    }
@-webkit-keyframes spin {
  to {
    -webkit-transform: rotate(1turn);
  }
}

    div:hover {
  -webkit-animation-play-state: running;
  animation-play-state: running;
}
</style>


    <div ontouchstart="">Hover over me and watch me spin!</div>

Comments

1

I had that problem and I could solve it in this way: (I just wanted to rotate and flap a photo with class of left-img) (and enjoy;))

.left-img{
-webkit-transform:rotate(-90deg) scaleX(-1);
-moz-transform: rotate(-90deg) scaleX(-1);
-ms-transform: rotate(-90deg) scaleX(-1);
-o-transform: rotate(-90deg) scaleX(-1);
transform: rotate(-90deg) scaleX(-1);

}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.