div+css布局实现方块人效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css布局实现方块人效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; } html, body { height: 100%; overflow: hidden; } body { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; margin: 0; background: #1e1e1e; background: linear-gradient(0deg, #1e1e1e 50%, #222 70%, #333); } /* ///////////////////// */ img { position: absolute; z-index: -1; opacity: 1; opacity: 0; width: 700px; translate: 130px -60px; } .soldier { position: relative; width: 200px; height: 360px; @media screen and (max-width: 600px) { &:nth-child(1) { display: none; } } @media screen and (max-width: 400px) { &:nth-child(3) { display: none; } } &::before { content: ""; display: block; width: 50%; height: 22px; background: #000; box-shadow: 0 0 0 8px #e94d6c88; position: absolute; bottom: 0; left: 0; right: 0; margin: auto; filter: blur(16px); border-radius: 100%; } .head { position: absolute; left: 0; right: 0; margin: auto; width: 74%; height: 46%; height: 164px; border-radius: 44% 44% 50% 50%; box-shadow: 0 5px 8px -4px #000a, 0 -3px 2px -1px #fff2, inset 6px 6px 3px -2px #fff5, inset 0 2px 3px 2px #fff6, inset 0 8px 4px 10px #e94d6c, inset 0 12px 2px 7px #fff, inset 0 12px 0 10px #691324, inset 0 14px 8px 16px #000, inset 0 42px 12px 16px #0003, inset 0 -32px 24px 16px #000c; background: repeating-linear-gradient( 0deg, #888 0px, #888 1px, transparent 3px, transparent 4px ), repeating-linear-gradient(90deg, #888 0px, #888 1px, #ccc 3px, #ccc 4px); &::before, &::after { content: ""; display: block; position: absolute; left: 0; right: 0; margin: auto; width: 78%; height: 10%; border-radius: 100%; box-shadow: inset 0 -4px 3px -3px #fff5, 0 8px 4px -4px #0005; top: 64%; } &::after { top: 68%; box-shadow: inset 0 -6px 2px -4px #aaa3, 0 6px 4px -4px #0003; } .square, .circle { position: absolute; left: 0; right: 0; top: 30%; margin: auto; width: 44.........完整代码请登录后点击上方下载按钮下载查看
网友评论0