代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> /* 清除默认样式 */ *{ padding: 0; margin: 0; box-sizing: border-box; } a{ text-decoration: none; } li{ list-style: none; } /* 静态 */ ul{ width: 300px; height: 40px; margin: 50px auto; } ul a{ display: block; width: 100px; height: 40px; color: #fff; text-align: center; line-height: 40px; } ul li{ float: left; height: 40px; transform-style: preserve-3d; transition: 0.5s; } ul a:first-child{ background-color: green; transform: translateZ(20px); } ul a:last-child{ background-color: orange; transform: translateY(-60PX) rotateX(90deg); } /* 动态 */ ul li:hover{ transform: rotateX(-90deg); } </style> </head> <body> <ul> <li> <a href="#">首页</a> <a href="#">index</a> </li> <li> <a href="#">登录</a> <a href="#">login</a> </li> <li> <a href="#">注册</a> <a href="#">register</a> </li> </ul> </body> </html>
效果图:
移动web-空间转换-3D导航案例
最新推荐文章于 2024-06-19 10:11:18 发布