日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 前端技术 > CSS >内容正文

CSS

CSS3实现太极图教程

發(fā)布時(shí)間:2024/1/18 CSS 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CSS3实现太极图教程 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

我們先來(lái)看效果:

制作步驟:

1、先畫個(gè)半圓

.box{ width: 300px;height: 150px;margin: 10em auto;border-width: 150px 0 0 0;border-style: solid;border-color: #000;border-radius: 50%;position: relative;animation: taiji 1.5s linear infinite}

2、畫左邊的圓


這里為了節(jié)省標(biāo)簽 就直接用偽類了

.box:before{ content: ""; position: absolute;top: -75px; left: 0; width: 45px;height: 45px; background: #000;border: 52.5px solid #fff;border-radius: 50%;}

3、畫右邊的圓

.box:after{ content: ""; position: absolute; top: -75px; right: 0; width: 45px; height: 45px; background: #fff;border: 52.5px solid #000;border-radius: 50%;}

4、在加個(gè)動(dòng)畫就完美了

@keyframes taiji {from {transform: rotate(0deg)}to {transform: rotate(360deg);}}

完整代碼:

<!doctype html> <html lang="en"> <head><meta charset="UTF-8"><title>小鑫博客</title><style>.box{ width: 300px;height: 150px;margin: 10em auto;border-width: 150px 0 0 0;border-style: solid;border-color: #000;border-radius: 50%;position: relative;animation: autoplay 1.5s linear infinite}.box:before{ content: ""; position: absolute;top: -75px; left: 0; width: 45px;height: 45px; background: #000;border: 52.5px solid #fff;border-radius: 50%;}.box:after{ content: ""; position: absolute; top: -75px; right: 0; width: 45px; height: 45px; background: #fff;border: 52.5px solid #000;border-radius: 50%;}@keyframes autoplay {from {transform: rotate(0deg)}to {transform: rotate(360deg)}}</style> </head> <body><div class="box"></div> </body> </html>

這里我在補(bǔ)充一點(diǎn):如果要改左右的圓心的大小 是要計(jì)算的 盒子的高度 - 偽類的邊框 x 2 = 圓心的大小

總結(jié)

以上是生活随笔為你收集整理的CSS3实现太极图教程的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。