# SetStyle Advanced Help

**URL:** <https://forum.code.org/t/setstyle-advanced-help/25770>\
**Category:** CS Principles\
**Tags:** csp-unit-5\
**Created:** [March 21, 2019, 3:26pm UTC](https://forum.code.org/t/setstyle-advanced-help/25770 "2019-03-21T15:26:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkeays](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jkeays/32/5313_2.png) [@jkeays](https://forum.code.org/u/jkeays)\
**Post date:** [March 21, 2019, 3:26pm UTC](https://forum.code.org/t/setstyle-advanced-help/25770/1 "2019-03-21T15:26:43Z")

</div>

I have a student wishing to “flip”, not rotate/spin an image within AppLab. Last year, Josh and Baker help us with rotating images for a spinner.

I am just not familiar with the subtleties of setStyle to know how to fix this problem.

Is it possible?

We do have a work around with going into a photo editor and making a flipped 2nd image but we are curious to know if you can flip images within appLab?

Thanks

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [March 21, 2019, 4:52pm UTC](https://forum.code.org/t/setstyle-advanced-help/25770/2 "2019-03-21T16:52:23Z")

</div>

Try something like this -

setStyle(“image1”,“transform: rotate(20deg);” )

---

<div class="post-metadata">

**Author:** ![josh](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/josh/32/868_2.png) [@josh](https://forum.code.org/u/josh)\
**Post date:** [March 21, 2019, 5:01pm UTC](https://forum.code.org/t/setstyle-advanced-help/25770/3 "2019-03-21T17:01:53Z")

</div>

You can use the CSS transforms `scaleX` and `scaleY` to flip horizontally and vertically, respectively. Eg:

`setStyle("image1", "transform: scaleX(-1);");`

---

<div class="post-metadata">

**Author:** ![jkeays](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jkeays/32/5313_2.png) [@jkeays](https://forum.code.org/u/jkeays)\
**Post date:** [March 21, 2019, 11:00pm UTC](https://forum.code.org/t/setstyle-advanced-help/25770/4 "2019-03-21T23:00:52Z")

</div>

> [@josh](#):
>
> setStyle(“image1”, “transform: scaleX(-1);”);

Thanks Josh.

> **[Check out what I made](https://studio.code.org/projects/applab/YXcw5jU5pyWfBftIr6biSNn2Sk3o0LYQWh3QmSYm5kk)**
>
> I wrote the code myself with Code.org

You’re the best!
