效果预览: https://sevlt.github.io/tai-chi/index.html
HTML:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Tai-chi</title> <link rel="stylesheet" href="style.css"> </head> <body> <div id="yinyang"></div> </html>
CSS:
body { background-color: #adadad;/*设置背景色*/ } #yinyang { width: 200px; height: 200px; border-radius: 50%; background: linear-gradient(/*圆球上半部分为白色,下半部分为黑色*/ to bottom, #ffffff 0%, #ffffff 50%, #000000 50%, #000000 100% ); position: relative; margin: 100px auto; } #yinyang::before { position