div+css布局一个卡通大胡子人物头部脸部效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css布局一个卡通大胡子人物头部脸部效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } html { font-size: 10px; } @media only screen and (max-width: 600px) { html { font-size: 8px; } } @media only screen and (max-width: 360px) { html { font-size: 6px; } } body { background-color: #aedfdb; } .container { height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; } .face { width: 20rem; height: 17rem; background-color: #f7c19d; border-radius: 45% 45% 0 0; position: relative; } .beard { position: relative; width: 20rem; height: 17rem; background-color: #324c59; border-radius: 0 0 50% 50%; box-shadow: 0 3.5rem 0 0 #000; display: flex; justify-content: center; } .beard::before { content: ""; position: absolute; left: 50%; top: 65%; transform: translateX(-50%); width: 14rem; height: 12rem; background-color: #e1796e; border-radius: 0 0 50% 50%; z-index: -10; } .beard::after { content: ""; position: absolute; left: 50%; top: 90%; transform: translateX(-50%); width: 14rem; height: 11.4rem; background-color: #e7967b; z-index: -20; } .mouth { position: absolute; top: 4.5rem; width: 10rem; height: 5rem; background-color: #820936; border-radius: 0 0 100vh 100vh; border-right: 2px solid #f61f5b; display: flex; justify-content: center; } .mouth::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); background-color: #fff; width: 7rem; height: 1.5rem; border-radius: 0 0 100vh 100vh; box-shadow: inset 0 0.5rem 0 0 rgba(0, 0, 0, 0.25); } .mouth::after { content: ""; position: absolute; left: 40%; bottom: 0; width: 5rem; height: 2.25rem; background-color: #f61f5b; border-radius: 10% 0% 86% 14%/10% 0% 100% 32%; } .mouth__cavity { width: 4rem; height: 4rem; background-color: #4b0213; border-radius: 50%; } .eyebrows { display: flex; justify-content: space-around; position: relative; top: 8rem; width: 18rem; left: 50%; transform: translateX(-50%); } @media only screen and (max-width: 600px) { .eyebrows { top: 7.5rem; } } .eyebrow { width: 3.5rem; height: 1.5rem; background-color: #000; border-radius: 100vh; box-shadow: 0 0.75rem 0 0 #e17970; } .eyes { display: flex; justify-content: space-around; position: relative; top: 11rem; width: 16rem; left: 50%; transform: translateX(-50%); } @media only screen and (max-width: 600px) { .eyes { top: 10.5rem; } } .eye { width: 1.75rem; height: 3rem; background-color: #000; border-radius: 100vh; } .eye::before { content: ""; position: absolute; width: 5rem; height: 5rem; border-radius: 50%; background-color: transparent; border: 5px solid #fff; top: -50%; } .eye::after { content: ""; position: absolute; width: 3.5rem; height: 4px; background-color: #fff; top: 50%; transform: translateY(-50%); } .eye--left::before { left: 1rem; } .eye--left::after { left: -2rem; } .eye--right::before { right: 1rem; } .eye--right::after { right: -2rem; } .glass-joint { width: 3rem; height: 4px; background-color: #fff; position: relative; top: 8rem; left: 50%; transform: translateX(-50%); } .ears { display: flex; justify-content: space-between; position: relative; top: 10.5rem; width: 24rem; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0