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 trialJunior Aidee
Front End Web Development Techdegree Graduate 14,657 Pointsbackface-visibility not working for me
Hello, I'm currently having the same issue. I followed Guil's code but it's not working for me.
web-kit backface-visibility doesn't work for me either
/* ================================= Photo 3D Transforms & Transitions ==================================== */
.content { perspective: 700px; }
.photo { transition: transform 1s cubic-bezier(.55, -.62, .27, 1.2);
}
.photo:hover { transform: rotateY(-180deg);
}
.side-a, .side-b { backface-visibility: hidden; transform-style: preserve-3d; }
.side-b { transform: rotateY(180deg); }
4 Answers
Steven Parker
231,261 PointsTry setting the 3-D style on the element that is being rotated:
.photo {
transition: transform 1s cubic-bezier(.55, -.62, .27, 1.2);
transform-style: preserve-3d; /* <-- add this */
}
Junior Aidee
Front End Web Development Techdegree Graduate 14,657 PointsSteven, after commenting out the transition property and adding the transform-style property to .photo, it still doesn't create the front and back images like in the video.
/* ================================= Photo 3D Transforms & Transitions ==================================== */
.content { perspective: 700px; }
.photo { /* transition: transform 1s cubic-bezier(.55, -.62, .27, 1.2); */ transform-style: preserve-3d; }
.photo:hover { transform: rotate3d(1, 0, 0, 180deg); }
.side-a, .side-b { backface-visibility: hidden; }
.side-b { transform: rotateX(180deg); }
Steven Parker
231,261 PointsI was only suggesting adding that property, not removing any.
Without the transition, it works but the "flip" is instant instead of animated; so put that back in.
Junior Aidee
Front End Web Development Techdegree Graduate 14,657 PointsThank you Steven!
Junior Aidee
Front End Web Development Techdegree Graduate 14,657 PointsOk I'll do that.