The transform property lets you rotate or flip, but how can you do both at the same time? Say I want to rotate an element 90 degrees and flip it horizontally? Both are done with the same property, so the latter overwrites the former. Here's an example fiddle for convenience:
http://jsfiddle.net/DtNh6/
transform: rotate(90deg); transform: scaleX(-1);
We can flip the img element using the CSS transform property. We can do so using the scaleX and scaleY transforms. The CSS to flip it. The rotation transform is also a nice choice for when you want to animate the flip.
You may do a transform: rotate(180deg); for the horizontal+vertical flip.
I fiddled with jsfiddle, and this worked:
$('#photo').css('transform', 'rotate(90deg) scaleX(-1)');
To relate it to your question, the resulting CSS looks like
transform: rotate(90deg) scaleX(-1);
The properties can be delimited by spaces, like so.
transform: rotate(90deg) scaleX(-1);
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