Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

卡片翻转动效 #6

Open
xiaotiandada opened this issue Jan 19, 2021 · 0 comments
Open

卡片翻转动效 #6

xiaotiandada opened this issue Jan 19, 2021 · 0 comments

Comments

@xiaotiandada
Copy link
Owner

2018-06-07 22:34:02

卡片翻转动效

地址

预览地址

资料

资料

视频地址

效果图

截图

截图

# html
<div class="container">
<div class="box">
<div class="positive"></div>
<div class="negative"></div>
</div>
</div>
# css

.box{
    position: relative;
    width: 250px;
    height: 380px;
    margin-left: auto;
    margin-right: auto;
    transform: rotateY(0deg);
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transition: transform .8s ease-in-out;
    -moz-transition: transform .8s ease-in-out;
    transition: transform .8s ease-in-out;

    -webkit-perspective: 800px;
    -moz-perspective: 800px;
    perspective: 800px;
}
.positive,
.negative{
    width: 250px;
    height: 380px;
    background-size: cover;
    position: absolute;
    backface-visibility: hidden;
    
}

.positive{
    transform: rotateY(0deg);
    background-image: url(../img/正面.jpg);
}
.negative{
    background-image: url(../img/反面.jpg);
    transform: rotateY(180deg);
}

.box:hover{
    transform: rotateY(180deg);        
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant