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> 

欢迎进群交流学习

相关推荐
可观测性用观测云3 分钟前
前端错误可观测最佳实践
前端
恋猫de小郭3 分钟前
Android 将强制应用使用主题图标,你怎么看?
android·前端·flutter
小帆聊前端14 分钟前
Flex 布局实战指南:从踩坑到精通,解决 90% 布局难题
css
一枚前端小能手25 分钟前
「周更第3期」实用JS库推荐:Lodash
前端·javascript
艾小码25 分钟前
Vue组件到底怎么定义?全局注册和局部注册,我踩过的坑你别再踩了!
前端·javascript·vue.js
Cyan_RA931 分钟前
计算机网络面试题 — TCP连接如何确保可靠性?
前端·后端·面试
谢尔登31 分钟前
【CSS】层叠上下文和z-index
前端·css
鹏多多32 分钟前
前端复制功能的高效解决方案:copy-to-clipboard详解
前端·javascript
AryaNimbus34 分钟前
你不知道的 Cursor系列(三):再也不用死记硬背 Linux 命令,终端 Cmd+K 来帮你!
前端·ai编程·cursor
uhakadotcom36 分钟前
Rollup 从0到1:TypeScript打包完全指南
前端·javascript·面试