Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Flipping a div by css3

    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 389
    Comment on it

    Hello Readers

    Here is the example of
    Flipping a div with css3 transitions and 3d transforms.

    <div id="container">
        <div id="card">
          <div class="frontFace">
            <h2>Hover Me to view effect</h2>
            <p>
                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae at consectetur iste dignissimos maiores placeat deleniti eum dolore, velit ab similique eligendi commodi perspiciatis excepturi labore facere. Ad, excepturi, distinctio?
            </p>
          </div>
          <div class="back frontFace">
            <h2>Thank You for hover. Here is your detail.</h2>
            <h3>This is nice for exposing more information.</h3>
            <p>
                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae at consectetur iste dignissimos maiores placeat deleniti eum dolore, velit ab similique eligendi commodi perspiciatis excepturi labore facere. Ad, excepturi, distinctio?
            </p>
          </div>
        </div>
    </div>
    

    Here is the Css

    *{
        padding: 0px;
        margin: 0px;
    }
    #container {
      position: relative;
      margin: 10px auto;
      width: 450px;
      height: 281px;
      z-index: 1;
    }
    
    #card {
      width: 100%;
      height: 100%;
      transform-style: preserve-3d;
      transition: all 1.0s linear;
    }
    #container:hover #card {
      transform: rotateY(180deg);
      box-shadow: -5px 5px 5px #aaa;
    }
    .frontFace {
       backface-visibility: hidden;
        background: #4cb0cd;
        color: #fff;
        height: 100%;
        padding: 2%;
        position: absolute;
        text-align: center;
        width: 100%;
    }
    .frontFace.back {
      display: block;
      transform: rotateY(180deg);
      box-sizing: border-box;
      padding: 2%;
      color: #fff;
      text-align: center;
      background-color: #f99926;
    }
    #container h2{margin-bottom: 2%;}
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: