Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Unused CSS Stages Transitions and Transforms 3D Transforms: Part 2

Thiago de Bastos
Thiago de Bastos
14,556 Points

CSS3 Page Flip

Hey guys! I have been struggling with creating a working CSS3 page flip event. I have been ok with the mouseover flip, the issue that I am having is when I mouse out. The flip seems to bug and reset. What am I doing wrong?

<body>
    <div class="wrap">
        <div class="side-a"></div>
        <div class="side-b"></div>
    </div>

    <div class="flip-container" ontouchstart="this.classList.toggle('hover');">
    <div class="flipper">
        <div class="front">
            <!-- front content -->
        </div>
        <div class="back">
            <!-- back content -->
        </div>
    </div>
</div>
body {
    -webkit-perspective: 800px;
    -webkit-perspective-origin: center center;
}

.wrap {
    transition: -webkit-transform 0.5s ease-in-out;
    -webkit-transform-style: preserve-3d;
}

.wrap div {
    position: absolute;
    -webkit-backface-visibility: hidden;
}

.side-a {
    z-index: 100;
}

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

.wrap:hover {
    -webkit-transform: rotate3d(0, 1, 0, 180deg);
    -webkit-transform-origin: center right;
}

1 Answer

Thiago de Bastos
Thiago de Bastos
14,556 Points

I figured this out. Thanks anyway