实例
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>对话框</title> <style type="text/css"> *{ margin: 0; padding: 0; } html,body{ height: 100%; overflow: hidden; } #test{ margin-top: 50px; margin-left: 10px; width: 644px; height: 334px; border: 1px solid; border-radius: 50%; text-align: center; font: 30px helvetica; line-height: 293px; position: relative; } #test::after{ position: absolute; display: block; content: ""; width: 80px; height: 80px; border: 1px solid; bottom: -65px; right: -12px; border-radius: 50%; } #test::before{ position: absolute; display: block; content: ""; width: 40px; height: 40px; border: 1px solid; bottom: -109px; right: -74px; border-radius: 50%; } </style> </head> <body> <div id="test">大家好,欢迎来到阿杰网络科技博客资源站</div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
实例
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>CSS风车练习</title> <style type="text/css"> *{ margin: 0; padding: 0; } html,body{ height: 100%; overflow: hidden; } #wrap{ width: 300px; height: 300px; position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto; transition: 2s; //多少秒内旋转完毕 这里设置的是2秒 } #wrap > div{ margin: 10px; width: 130px; height: 130px; background: hotpink; float: left; box-sizing: border-box; } #wrap > div:nth-child(1),#wrap > div:nth-child(4){ border-radius: 0 60%; } #wrap > div:nth-child(2),#wrap > div:nth-child(3){ border-radius: 60% 0; } #wrap:hover{ transform: rotate(120deg); //旋转120度 } </style> </head> <body> <div id="wrap"> <div></div> <div></div> <div></div> <div></div> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例