Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>太极图作业</title> <style type="text/css"> .background { width: 400px; height: 400px; margin: 0 auto; background-color: gold; padding-top: 99px; box-sizing: border-box; } .circle-box { width: 200px; height: 200px; border-radius: 50%; /*border: 1px solid #ff0000;*/ position: relative; background: #fff; margin: 0 auto; overflow: hidden; } .bg-mask { width: 100%; height: 100px; background-color: #000; } .circle-black-m,.circle-white-m{ width: 100px; height: 100px; border-radius: 50%; } .circle-black-m { background-color: #000; position: absolute; top: 51px; } .circle-white-m { background-color: #fff; /*border: 1px solid #ff0000;*/ position: absolute; top: 50px; right: 0; } .circle-white,.circle-black { width: 30px; height: 30px; border-radius: 50%; position: absolute; } .circle-white { background-color: #fff; top: 45px; left: 35px; } .circle-black { background-color: #000; top: 25px; left: 35px; } /*鼠标经过变色*/ /*.circle-box:hover { background: #000; } .circle-box:hover .bg-mask{ background-color: #fff; }*/ /* 动画代码 */ @keyframes turnZ { 0% {transform: rotateZ(360deg);} 100% {transform: rotateZ(0deg);} } /* 应用动画的元素 */ .circle-box:hover { animation-name: turnZ; animation-duration: 4s; animation-iteration-count: 1; } </style> </head> <body> <div class="background"> <div class="circle-box"> <div class="bg-mask"></div> <div class="circle-black-m"> <div class="circle-white"></div> </div> <div class="circle-white-m"> <div class="circle-black"></div> </div> </div> </div> </body> </html>