博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
旋转菜单
阅读量:4977 次
发布时间:2019-06-12

本文共 2014 字,大约阅读时间需要 6 分钟。

<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="UTF-8">
<title>翻转菜单</title>

<style>

/* basic menu styles */
.block-menu {
display: block;
background: #000;
}

.block-menu li {

display: inline-block;
}

.block-menu li a {

color: #fff;
display: block;
text-decoration: none;
font-family: 'Passion One', Arial, sans-serif;
font-smoothing: antialiased;
text-transform: uppercase;
overflow: visible;
line-height: 20px;
font-size: 24px;
padding: 15px 10px;
}

/* animation domination */

.three-d {
perspective: 200px;
transition: all .07s linear;
position: relative;
cursor: pointer;
}
/* complete the animation! */
.three-d:hover .three-d-box,
.three-d:focus .three-d-box {
transform: translateZ(-25px) rotateX(90deg);
}

.three-d-box {

transition: all .3s ease-out;
transform: translatez(-25px);
transform-style: preserve-3d;
pointer-events: none;
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
}

/*

put the "front" and "back" elements into place with CSS transforms,
specifically translation and translatez
*/
.front {
transform: rotatex(0deg) translatez(25px);
}

.back {

transform: rotatex(-90deg) translatez(25px);
color: #ffe7c4;
}

.front, .back {

display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: black;
padding: 15px 10px;
color: white;
pointer-events: none;
box-sizing: border-box;
}
</style>
</head>
<body>
<ul class="block-menu">
<li><a href="/" class="three-d">
Home
<span aria-hidden="true" class="three-d-box">
<span class="front">Home</span>
<span class="back">Home</span>
</span>
</a></li>
<li><a href="/demos" class="three-d">
Demos
<span aria-hidden="true" class="three-d-box">
<span class="front">Demos</span>
<span class="back">Demos</span>
</span>
</a></li>
<li><a href="/demos" class="three-d">
菜单
<span aria-hidden="true" class="three-d-box">
<span class="front">标签</span>
<span class="back">标签</span>
</span>
</a></li>
<!-- more items here -->
</ul>
</body>
</html>

转载于:https://www.cnblogs.com/jinjinjin/p/5682623.html

你可能感兴趣的文章
PHP数组实际占用内存大小的分析
查看>>
文本比较算法三——SUNDAY 算法
查看>>
用bcdedit.exe重建bcd
查看>>
关于元素透明
查看>>
Leetcode 516. Longest Palindromic Subsequence
查看>>
MinDoc文档管理系统搭建
查看>>
[HNOI2011] 数学作业
查看>>
在IDEA中创建Maven项目和添加tomcat
查看>>
ADO MFC SQL2000
查看>>
Hie with the Pie
查看>>
2019.01.04 bzoj2962: 序列操作(线段树+组合数学)
查看>>
ThinkPHP5集成支付宝手机网站支付接口
查看>>
hdu 3584 Cube (三维树状数组,更新区间,查询单点)
查看>>
lvs基础
查看>>
接口测试 rest-assured 使用指南
查看>>
Java 8简明教程
查看>>
Java线程池使用说明
查看>>
ectouch第十一讲 之 ECTouch 菜单里如何添加文章链接
查看>>
adb logcat
查看>>
VME总线 分类: 生活百科 2014-06-...
查看>>