css布局实现男士绅士眨眼动画效果代码
代码语言:html
所属分类:布局界面
代码描述:css布局实现男士绅士眨眼动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> .creatures { width: 100%; height: 100%; background-color: #3567aa; position: absolute; top: 0; left: 0; } .human { width: 100%; height: 100%; float: left; background-color: #3567aa; overflow: hidden; } .hat { margin: 10% auto -18px; width: 90px; height: 60px; background-color: rgb(31,33,43); border-radius: 3px 2px 0 0; position: relative; z-index: 10; } .hat:before { content: ""; width: 100%; height: 6px; border-radius: 50%; background-color: rgb(31,33,43); position: absolute; top: -3px } .hat:after { content: ""; width: 150%; height: 5px; background-color: rgb(31,33,43); position: absolute; bottom: -5px; left: -25%; } .head { width: 100px; height: 100px; background-color: rgb(246,208,166); border-radius: 50%; margin: 0 auto; z-index: 2; position: relative; } .head:after { content: ""; position: absolute; top: 90px; left: 50%; margin-left: -15px; width: 30px; height: 40px; background-color: rgb(246,208,166); } .eyes { width: 25px; height: 25px; background-color: white; position: absolute; top: 30px; border-radius: 50%; } .blink { width: 27px; height: 27px; position: absolute; top: -25px; left: -1px; z-index: 2; border-radius: 0 0 10px 10px; background-color: rgb(246,208,166); animation: blinks 5s ease-in-out 2s infinite; } @keyframes blinks { 0% { top: -25px; } 10% { top: 0px; } 20% { top: -25px; } } .eyes.left { left: 20px; } .eyes.right { right: 20px; } .eyes:before { content: ""; position: absolute; width: 15px; height: 19px; top: 20%; left: 20%; background-color: black; border-radius: 50%; } .eyes:after { content: ""; position: absolute; width: 5px; height: 5px; top: 24%; left: 50%; background-color: white; border-radius: 50%; } .left.eyes:after { left: 19% } .right.eyes:after { left: 58% } .mouth { position: absolute; left: 50%; bottom: 10%; margin-left: -20px; background-color: black; width: 40px; height: 20px; border-radius: 10px 10px 70px 70px; overflow: hidden; } .mouth:before { content: ""; height: 4px; width: 20px; background-color: white; position: absolute; top: 0; left: 10px; border-radius: 0px 0px 50px 50px; } .mouth:after { content: ""; height: 6px; width: 20px; background-color: red; position: absolute; bottom: -2px; left: 10px; border-radius: 50px 50px 50px 50px; } .human .body { height: 170px; width: 100px; background-color: rgb(31,33,43); margin: 30px auto 0; position: relative; z-index: 2; } .human .bow { width: 20px; height: 20px; background-color: red; position: absolute; top: -25px; left: 50%; margin-left: -10px; z-index: 3; border-radius: 50%; } .human .bow:before { content: ""; position: absolute; right: 0%; top: 0px; width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid .........完整代码请登录后点击上方下载按钮下载查看
网友评论0