纯css绘制鸭子效果
代码语言:html
所属分类:布局界面
代码描述:纯css绘制鸭子效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> :root { --duck-green: #19451C; --duck-brown: #76514A; --duck-accent: #8E6F69; --bill-color: #F7C100; --background-color: #333642; --water-color: #4EB2ED; } body{ background: var(--background-color); } .box-canvas{ position: relative; margin: auto; margin-top: 15%; margin-bottom: 8%; width: 600px; height:600px; } .head { position: absolute; left: 100px; background: var(--duck-green); width: 95px; height: 85px; border-radius: 50%; } /* Neck */ .head::before { content: ''; position: absolute; bottom: -25px; right: 0; width: 50px; height: 60px; background: var(--duck-green); border-radius: 0 0 30% 30%; border-bottom: 10px solid white; } /* Eye */ .head::after { content: ''; position: absolute; left: 30px; top: 25px; width: 15px; height: 15px; background: black; border-radius: 50%; } .bill { position: absolute; left: 58px; top: 50px; background: var(--bill-color); height: 12px; width: 50px; border-radius: 20% 0 20% 20%; } .bill::before { content: ''; position: absolute; right: 0; top: -15px; background: var(--bill-color); height: 15px; width: 25px; clip-path: polygon(75% 0, 0 100%, 100% 100%); } .body { position: absolute; le.........完整代码请登录后点击上方下载按钮下载查看
网友评论0