css布局实现一个卡通鱼效果代码
代码语言:html
所属分类:布局界面
代码描述:css布局实现一个卡通鱼效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { display: flex; height: 100vh; margin: 0; justify-content: center; place-items: center; background: #3C8BD0; } .face { height: 300px; width: 290px; border-radius: 50%; background: #46A3F3; box-shadow: inset 14px 0 #367fbf, inset -14px 0 #367fbf; position: relative; } .eye { position: absolute; height: 160px; width: 150px; background: #FEFCFF; border-radius: 50%; top: 44px; box-shadow: inset 7px 0 #367fbf, inset -7px 0 #367fbf, inset 0 2px #367fbf, inset 0 -2px #367fbf; } .eye1 { left: -26px; } .eye2 { right: -26px; } .eye::before { content: ""; position: absolute; height: 120px; width: 100px; background: #EC5ABD; border-radius: 50%; top: 50%; transform: translatey(-50%); right: 6px; } .eye::after { content: ""; position: absolute; height: 90px; width: 80px; background: #373737; border-radius: 50%; top: 50%; transform: translatey(-50%); right: 7px; } .eye2::after { left: 7px; } .eye2::before { left: 6px; } .pupil { height: 20px; width: 20px; background: white; border-radius: 50%; position: absolute; top: 40px; z-index: 10; } .pupil { right: 16px; } .pupil2 { right: 66px; } .mouth { height: 26px; width: 80px; background: #373636; border-radius: 10% 10% 35% 35% / 10% 10% 50% 50%; position: absolute; left: 50%; transform: translatex(-50%); bottom: 60px; } .mouth::before { height: 6px; background: white; width: 40px; position: absolute; content: ''; left: 50%; transform: translatex(-50%); border-radius: 0 0 4px 4px; } .mouth::after { background: #E36539; height: 12px; width: 46px; content: ""; position: absolute; left: 50%; transform: translatex(-50%); bottom: 0; border-radius: 50% 50% 8px 8px; } .........完整代码请登录后点击上方下载按钮下载查看
网友评论0