HTML+CSS太极效果(附源码!!!)

展示效果

源码

html 复制代码
<!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>css做的太极,鼠标触发旋转</title>
    <style>
      body {
      	background-color:#999;
      }
      .bg {
      	height:800px;
      }
      .d1 {
      	margin:0 auto;
      	margin-top:150px;
      	width:400px;
      	height:400px;
      	transition-duration:0.5s;
      }
      .taiji {
      	width:300px;
      	height:300px;
      	background-color:black;
      	position:absolute;
      	top:200px;
      	left:540px;
      	margin:0 auto;
      	border-radius:200px 200px;
      	transition-duration:5s;
      }
      .tr {
      	width:150px;
      	height:300px;
      	background-color:white;
      	border-radius:200px 0 0 200px;
      	transition-duration:5s;
      }
      .trr {
      	width:150px;
      	height:150px;
      	border-radius:200px 200px 200px 200px;
      	position:relative;
      	left:80px;
      	background-color:white;
      }
      .trr1 {
      	background-color:black;
      }
      .trr2 {
      	top:50px;
      	left:50px;
      	width:40px;
      	height:40px;
      	background-color:black;
      }
      .trr3 {
      	background-color:white;
      }
      .d1:hover {
      	background-color:#999;
      	/* transition:50px 50px; */
      	/* transform:scaleX(2); */
      }
      .taiji:hover {
      	transform:scale(2.5) rotate(180deg);
      	opacity:0.05;
      }
      .tr:hover {
      	color:white;
      }
    </style>
  </head>
  <body>
    <div class="d1">
      <div class="taiji">
        <div class="tr">
          <div class="bg">
            <div class="trr">
              <div class="trr trr2"></div>
            </div>
            <div class="trr trr1">
              <div class="trr trr2 trr3"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html> 

欢迎进群交流学习

相关推荐
RainbowSea24 分钟前
NVM 切换 Node 版本工具的超详细安装说明
java·前端
读书点滴30 分钟前
笨方法学python -练习14
java·前端·python
Mintopia37 分钟前
四叉树:二维空间的 “智能分区管理员”
前端·javascript·计算机图形学
Mintopia1 小时前
Three.js 深度冲突:当像素在 Z 轴上玩起 "挤地铁" 游戏
前端·javascript·three.js
Penk是个码农1 小时前
web前端面试-- MVC、MVP、MVVM 架构模式对比
前端·面试·mvc
MrSkye1 小时前
🔥JavaScript 入门必知:代码如何运行、变量提升与 let/const🔥
前端·javascript·面试
白瓷梅子汤1 小时前
跟着官方示例学习 @tanStack-form --- Linked Fields
前端·react.js
爱学习的茄子1 小时前
深入理解JavaScript闭包:从入门到精通的实战指南
前端·javascript·面试
zhanshuo2 小时前
不依赖框架,如何用 JS 实现一个完整的前端路由系统
前端·javascript·html
火柴盒zhang2 小时前
websheet在线电子表格(spreadsheet)在集团型企业财务报表中的应用
前端·html·报表·合并·spreadsheet·websheet·集团财务