当前位置: 首页 > news >正文

3D旋转tab图

上图

代码

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>3D旋转tab图</title><style>* {margin: 0;padding: 0;}body {height: 100vh;background: linear-gradient(to top, #29323c, #485563);}.container {width: 500px;display: flex;position: absolute;left: 50%;top: 50%;transform: translate(-45%, -50%);color: #ffffff;text-transform: uppercase;perspective: 1300px;}input {display: none;}.labels {height: 250px;display: flex;flex-direction: column;justify-content: space-between;}.tab {width: 100px;height: 80px;line-height: 80px;text-align: center;cursor: pointer;}.tab:nth-child(1) {background-color: #00b4db;}.tab:nth-child(2) {background-color: #009bc5;}.tab:nth-child(3) {background-color: #007ba4;}.content {width: 95%;height: 230px;position: absolute;display: flex;justify-content: center;align-items: center;flex-direction: column;background-color: red;}.content h1 {font-size: 28px;}.content p {font-size: 14px;}.content:nth-child(1) {background-color: #00b4db;transform: rotateX(-270deg) translateY(-115px);transform-origin: top center;}.content:nth-child(2) {background-color: #009bc5;transform: translateZ(115px);}.content:nth-child(3) {background-color: #007ba4;transform: rotateX(-90deg) translateY(115px);transform-origin: bottom center;}.cube {position: relative;flex: 1;transform-style: preserve-3d;transition: transform 0.5s ease-in;}#top:checked ~ .cube {transform: rotateX(-90deg);}#middle:checked ~ .cube {transform: rotateX(0deg) translateY(10px);}#bottom:checked ~ .cube {transform: rotateX(90deg);}</style>
</head>
<body>
<div class="container"><input type="radio" name="tabs" id="top" checked/><input type="radio" name="tabs" id="middle"/><input type="radio" name="tabs" id="bottom"/><div class="cube"><div class="content"><h1>top content</h1><p>this is top content</p></div><div class="content"><h1>middle content</h1><p>this is middle content</p></div><div class="content"><h1>bottom content</h1><p>this is bottom content</p></div></div><div class="labels"><label for="top" class="tab">top</label><label for="middle" class="tab">middle</label><label for="bottom" class="tab">bottom</label></div>
</div>
</body>
</html>

http://www.lryc.cn/news/252632.html

相关文章:

  • openGL 三:矩阵和向量
  • Socket和Http的通讯原理,遇到攻击会受到哪些影响以及如何解决攻击问题。
  • 【springboot】整合redis
  • 回溯和分支算法
  • 深入理解:指针变量的解引用 与 加法运算
  • Docker 镜像构建的最佳做法
  • 工作上Redis安装及配置
  • 电商项目之Web实时消息推送(附源码)
  • 上机实验四 哈希表设计 西安石油大学数据结构
  • Ubuntu22.04 交叉编译mp4V2 for Rv1106
  • 缓存穿透、击穿、雪崩
  • (1w字一篇理解透Unsafe类)Java魔法类:Unsafe详解
  • Python的正则表达式使用
  • Elasticsearch:评估 RAG - 指标之旅
  • 【2023.12.4练习】数据库知识点复习测试
  • 【wvp】测试记录
  • 【若依框架实现上传文件组件】
  • 玩转大数据5:构建可扩展的大数据架构
  • 【华为数据之道学习笔记】非数字原生企业的特点
  • Kubernetes学习笔记-Part.01 Kubernets与docker
  • k8s学习
  • 测试:JMeter和LoadRunner比较
  • (C语言)通过循环按行顺序为一个矩阵赋予1,3,5,7,9,等奇数,然后输出矩阵左下角的值。
  • GitHub项目推荐-Deoldify
  • 微前端qiankun示例 Umi3.5
  • 熬夜会秃头——beta冲刺Day7
  • IntelliJ IDEA设置中文界面
  • RTSP流媒体播放器
  • 使用正则表达式时-可能会导致性能下降的情况
  • Maven生命周期