【学习任务】让我们用学过的知识实现大白的绘制吧
我要参与
【学习任务】让我们用学过的知识实现大白的绘制吧
学习任务 683
等34人参与
来源: 第12周 / Python全能工程师

大白——迪士尼动画《超能陆战队》中的健康机器人,是一个体型胖胖的充气机器人,因呆萌的外表和善良的本质获得大家的喜爱,被称为“萌神”。那可以用编程的方式画出大白吗?回答当然是肯定的,现在就让我们用学过的知识html,css来动手实现吧!

//img1.sycdn.imooc.com//climg/601cac5a295f3edf05001000.jpg

任务描述:

1、实现大白可以分为下述几部分:头部、躯干、腹部、手臂(左手,右手)、腿部(左腿,右腿)
2、div圆角边框可以使用border-radius实现
3、使用transform可以旋转元素
4、使效果图水平居中显示

去发布

登录后即可发布作业,立即

我的作业

全部作业 34

慕雪6704168
绘制大白

.head {
width: 100px;
height: 100px;
background-color: white;
border-radius: 50%;
position: relative;
margin-bottom: -30px;
}

.head::before {
content: “”;
width: 10px;
height: 10px;
background-color: black;
border-radius: 50%;
position: absolute;
left: 30px;
top: 40px;
}

.head::after {
content: “”;
width: 10px;
height: 10px;
background-color: black;
border-radius: 50%;
position: absolute;
right: 30px;
top: 40px;
}

.head::before {
content: “”;
width: 40px;
height: 5px;
background-color: black;
position: absolute;
left: 30px;
top: 50px;
}

/* 躯干样式 */
  • 1
代码块
复制 预览
复制成功!

.torso {
width: 200px;
height: 300px;
background-color: white;
border-radius: 50% 50% 0 0;
position: relative;
}

/* 腹部样式 */
  • 1
代码块
复制 预览
复制成功!

.abdomen {
width: 180px;
height: 220px;
background-color: white;
border-radius: 50%;
position: absolute;
bottom: 0;
left: 10px;
}

/* 左臂样式 */
  • 1
代码块
复制 预览
复制成功!

.left - arm {
width: 60px;
height: 180px;
background-color: white;
border-radius: 50% 0 0 50%;
position: absolute;
left: -60px;
top: 100px;
transform: rotate(-10deg);
}

/* 左手样式 */
  • 1
代码块
复制 预览
复制成功!

.left - hand {
width: 40px;
height: 40px;
background-color: white;
border-radius: 50%;
position: absolute;
bottom: 0;
left: 10px;
}

/* 右臂样式 */
  • 1
代码块
复制 预览
复制成功!

.right - arm {
width: 60px;
height: 180px;
background-color: white;
border-radius: 0 50% 50% 0;
position: absolute;
right: -60px;
top: 100px;
transform: rotate(10deg);
}

/* 右手样式 */
  • 1
代码块
复制 预览
复制成功!

.right - hand {
width: 40px;
height: 40px;
background-color: white;
border-radius: 50%;
position: absolute;
bottom: 0;
right: 10px;
}

/* 左腿样式 */
  • 1
代码块
复制 预览
复制成功!

.left - leg {
width: 60px;
height: 100px;
background-color: white;
border-radius: 0 0 50% 50%;
position: absolute;
left: 60px;
bottom: -100px;
}

/* 右腿样式 */
  • 1
代码块
复制 预览
复制成功!

.right - leg {
width: 60px;
height: 100px;
background-color: white;
border-radius: 0 0 50% 50%;
position: absolute;
right: 60px;
bottom: -100px;
}

提交于  2025-04-17 15:47:46
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师