css+div布局实现拿着气球的小女孩效果代码
代码语言:html
所属分类:布局界面
代码描述:css+div布局实现拿着气球的小女孩效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { overflow: hidden; } article { --line: #632; --skin: #fdc; --hair: #963; --hair-dark: #852; --ribbon: #fe8; --balloon: #c47; width: 80vmin; aspect-ratio: 1; position: absolute; color: #632; top: 50%; left: 50%; transform: translate(-50%, -59%); } article *, article *::before, article *::after { position: absolute; box-sizing: border-box; } .head { width: 50%; height: 50%; border-radius: 50%; left: 50%; top: 10%; transform: translateX(-50%); } .hair { width: 105%; aspect-ratio: 1; border: 0.8vmin solid; border-radius: 50%; clip-path: polygon(0 0, 100% 0, 100% 70%, 0 70%); background: var(--hair); left: 50%; top: -1%; transform: translateX(-50%); } .ear { width: 20%; aspect-ratio: 1; border: 0.8vmin solid; background: var(--skin); border-radius: 50%; top: 74%; left: 5%; transform: translate(-50%, -50%); } .ear + .ear { left: auto; right: 5%; transform: translate(50%, -50%); } .bangs { width: 115%; aspect-ratio: 1; background: /* border */ radial-gradient(farthest-side at 50% 100%, #0000 20%, var(--line) 20.5% calc(20.5% + 0.6vmin), #0000 0) 17% 40.5% / 7% 6%, radial-gradient(farthest-side at 50% 100%, #0000 20%, var(--line) 20.5% calc(20.5% + 0.6vmin), #0000 0) 34.5% 40.5% / 7% 6%, radial-gradient(farthest-side at 50% 100%, #0000 20%, var(--line) 20.5% calc(20.5% + 0.6vmin), #0000 0) 49.5% 39% / 8% 7%, radial-gradient(farthest-side at 50% 100%, #0000 20%, var(--line) 20.5% calc(20.5% + 0.6vmin), #0000 0) 66.5% 40.5% / 8% 6%, radial-gradient(farthest-side at 50% 100%, #0000 10%, var(--line) 10.5% calc(10.5% + 0.6vmin), #0000 0) 80.5% 43% / 3% 6%, radial-gradient(at 50% 20%, #0000 40%, var(--line) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 0% 50% / 25% 15%, radial-gradient(at 50% 20%, #0000 40%, var(--line) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 18% 50% / 30% 17%, radial-gradient(at 50% 20%, #0000 40%, var(--line) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 40% 48% / 25% 15%, radial-gradient(at 50% 20%, #0000 40%, var(--line) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 60% 50% / 30% 16%, radial-gradient(at 50% 20%, #0000 40%, var(--line) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 79% 50% / 25% 15%, radial-gradient(at 50% 20%, #0000 40%, var(--line) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 99% 50% / 25% 15%, /* hairs */ radial-gradient(100% 100% at 100% 100%, #0000 calc(99.9% - 0.8vmin), var(--hair-dark) 0 99.9%, #0000 99.9%) 17% 0% / 44% 53%, radial-gradient(100% 100% at 100% 100%, #0000 calc(99.9% - 0.8vmin), var(--hair-dark) 0 99.9%, #0000 99.9%) 40% -5% / 40% 55%, radial-gradient(100% 100% at 100% 85%, #0000 calc(99.9% - 0.8vmin), var(--hair-dark) 0 99.9%, #0000 99.9%) 60% -5% / 40% 52%, radial-gradient(100% 100% at 0% 60%, #0000 calc(99.9% - 0.8vmin), var(--hair-dark) 0 99.9%, #0000 99.9%) 30% -5% / 40% 55%, radial-gradient(100% 100% at 0% 90%, #0000 calc(99.9% - 0.8vmin), var(--hair-dark) 0 99.9%, #0000 99.9%) 60% -5% / 40% 55%, radial-gradient(100% 100% at 0% 90%, #0000 calc(99.9% - 0.8vmin), var(--hair-dark) 0 99.9%, #0000 99.9%) 80% 5% / 40% 50%, /* color fill */ radial-gradient(at 50% 20%, var(--hair) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 0% 50% / 25% 15%, radial-gradient(at 50% 20%, var(--hair) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 18% 50% / 30% 17%, radial-gradient(at 50% 20%, var(--hair) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 40% 48% / 25% 15%, radial-gradient(at 50% 20%, var(--hair) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 60% 50% / 30% 16%, radial-gradient(at 50% 20%, var(--hair) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 79% 50% / 25% 15%, radial-gradient(at 50% 20%, var(--hair) 40.5% calc(40.5% + 0.8vmin), #0000 calc(41% + 0.8vmin)) 99% 50% / 25% 15%, linear-gradient(var(--hair) 49%, #0000 0); background-repeat: no-repeat; left: 50%; transform: translate(-50%, -10%); border-radius: 100% 100% 0 0; } .face { width: 90%; aspect-ratio: 1; border: 0.8vmin solid; left: 50%; bottom: 0; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 23% 85%, #f002 11%, #0000 0), radial-gradient(circle at 77% 85%, #f002 11%, #0000 0), var(--skin); } .eye { --pos: 24%; width: 13%; height: 14%; background: radial-gradient(circle at 34% 34%, #fff 15%, #0000 16%), radial-gradient(circle at 20% 55%, #fff 7%, #0000 8%), var(--line); border-radius: 50%; top: 62%; right: var(--pos); } .eye::before { content: ""; width: 180%; height: 260%; left: 50%; transform: translate(-41%, -4%); border: 0.8vmin solid #0000; border-radius: 50%; border-top-color: var(--line); border-left: 0.7vmin solid #0000; } .eye::after { content: ""; width: 220%; height: 260%; left: 50%; transform: translate(-40%, -25%); border: 0.9vmin solid #0000; border-radius: 50%; border-top-color: var(--line); border-left: 0.7vmin solid #0000; } .eye + .eye { left: var(--pos); } .eye + .eye::before { transform: translate(-60%, -4%); border-left: 0.8vmin solid #0000; } .eye + .eye::after { transform: translate(-60%, -25%); } .nose { width: 8%; aspect-ratio: 1; border: 0.8vmin solid #0000; border-top-color: var(--line); border-right-color: var(--line);.........完整代码请登录后点击上方下载按钮下载查看
网友评论0