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> 

欢迎进群交流学习

相关推荐
前端snow20 分钟前
ai agent --- postgreSQL 关系型数据库
前端
卷无止境1 小时前
ECharts:把数据变成故事的可视化利器
前端
Eric_见嘉1 小时前
在职前端 Skill 和 MCP 分享
前端·后端·agent
liangshanbo12152 小时前
面试题:如何优化 Webpack 的打包速度?
前端·webpack·node.js
wengad2 小时前
从 wangEditor 迁到 wangEditor-next
前端·javascript·vue.js
行者-全栈开发3 小时前
【前端/JS框架】CVE-2026-3854:GitHub Enterprise Server X-Stat注入XSS漏洞深度剖析与紧急修复指南
前端·javascript·github
计算机魔术师4 小时前
AMD砸82亿买下李飞飞,这次不卖芯片卖什么?
前端
hzxpaipai4 小时前
杭州企业官网怎么建设?从策划到上线的5步建站方法
运维·服务器·前端·网络
怕浪猫4 小时前
2026年金九银十,我面了22个前端
前端·javascript·面试
IT_陈寒5 小时前
Vue 这个响应式陷阱,我的头发都掉没了
前端·人工智能·后端