Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Transitions and Transforms Adding 3D Effects with CSS Create a Flipping Animation with 3D Transform Properties

Shuming Li
PLUS
Shuming Li
Courses Plus Student 3,592 Points

The backface-visibility property is not working.

.content { perspective: 700px; }

.photo { transition: transform 1s ease-out; transform-style: perserve-3d; }

.photo:hover { transform: rotateY(-180deg); }

.side-a, .side-b { backface-visibility: hidden; }

.side-b { transform: rotateY(180deg); }

4 Answers

Steven Parker
Steven Parker
231,269 Points

It's just a typo. You have "perserve-3d" instead of "preserve-3d".

The "backface-visibility" property only works when ""preserve-3d" is set.

Shuming Li
Shuming Li
Courses Plus Student 3,592 Points

It still doesn't work after I corrected it.


.content { perspective: 700px; }

.photo { transition: transform 1s cubic-bezier(.55, -.62, .27, 1.2); transform-style: preserve-3d; }

.photo:hover { transform: rotateY (-180deg); }

.side-a, .side-b { backface-visibility: hidden; }

.side-b { transform: rotateY(180deg); }



Steven Parker
Steven Parker
231,269 Points

You apparently made other changes while applying the fix. The new code has a space between "rotateY" and the argument in parentheses that follows it, which causes the ".photo:hover" rule to be ignored.

Tomasz Denkiewicz
Tomasz Denkiewicz
11,778 Points

I had the same problem. You'll have to add property transform-style: preserve-3d to .side-a, side-b

.content {
  perspective: 700px;
}

.photo {
  transition: transform 1s ease-in-out ;
  transform-style: preserve-3d;

}

.photo:hover {
  transform: rotateY(-180deg);
}

.side-a,
.side-b {
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.side-b {
  transform: rotateY(180deg);
}

/* it works on my machine ¯\_(ツ)_/¯ */
Gari Merrifield
Gari Merrifield
9,598 Points

You also need to add "transform-style: preserve-3d;" on the ".photo-container" if this problem is while using Firefox.

My backface-visibility isn't working as well

.content{ perspective:700px; } .photo{ transition: transform 1s ease-out; transform-style: preserve-3d; } .photo:hover{ transform: rotatey(-180deg); }

.side-a{ backface-visibility: hidden; }

I have tried a variety of fixes from the forums and nothing seems to work.

Steven Parker
Steven Parker
231,269 Points

The transform name "rotateY" needs a capital "Y".