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

翻牌效果 #107

Open
coconilu opened this issue Nov 3, 2018 · 0 comments
Open

翻牌效果 #107

coconilu opened this issue Nov 3, 2018 · 0 comments

Comments

@coconilu
Copy link
Owner

coconilu commented Nov 3, 2018

实现步骤

一般而言,需要一个容器,包裹两个单面元素。

容器必须要设置:

position: relative;
transform-style: preserve-3d;

relative可以保证子元素的absolute生效;transform-style启用3D效果的翻转

两个单面元素必须要设置:

backface-visibility: hidden;
position: absolute;

backface-visibility指示当元素翻转180度后(也就是背面),是不显示的

效果展示

可以看看我写在CodePen上的示例

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