安卓小人html制作,安卓小人.html

本文详细解析了如何使用HTML、CSS和JavaScript在安卓应用中创建独特的绿色小绿人角色,通过CSS动画和伪元素技巧展示视觉效果,适合前端开发者进阶学习。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安卓小绿人

*{

margin: 0;

padding: 0;

}

body {

background-color: darkolivegreen;

}

.all {

width: 800px;

height: 800px;

border: 1px solid #ccc;

margin: 50px auto;

}

.ear {

width: 300px;

height: 150px;

position: relative;

margin: 0 auto;

}

.ear::before,

.ear::after {

content: "";

position: absolute;

width:20px;

height: 120px;

border-radius: 10px 10px 0 0;

background-color: yellowgreen;

}

.ear::before {

transform: rotate(-45deg);

left: 20px;

top: 130px;

}

.ear::after {

transform: rotate(45deg);

right: 20px;

top: 130px;

}

.head {

width: 300px;

height: 150px;

background-color: yellowgreen;

margin: 15px auto;

border-radius: 150px 150px 0 0;

position: relative;

}

/* 使用伪元素添加眼睛 */

.head::before,

.head::after{

/*1.一定设置content属性*/

content: '';

/*2.如果需要设置宽度就应该转换其为块级元素,它默认是行级元素 float display position*/

position: absolute;

width: 25px;

height: 25px;

border-radius: 50%;

background-color: #fff;

bottom: 45px;

}

.head::before{

left: 80px;

}

.head::after{

right: 80px;

}

.body {

width: 300px;

height: 300px;

background-color:yellowgreen;

border-radius: 0 0 25px 25px;

margin: 0 auto;

position: relative;

}

.body::before,

.body::after{

content: "";

position: absolute;

background-color: yellowgreen;

height: 200px;

width: 40px;

top: 30px;

border-radius: 15px;

}

.body::before{

left: -50px;

}

.body::after{

right: -50px;

}

.foot{

width: 300px;

height: 150px;

position: relative;

margin: 0 auto;

}

.foot::before,

.foot::after{

content: '';

position: absolute;

top: 0px;

background-color:yellowgreen;

width: 40px;

height: 100px;

border-radius: 0 0 15px 15px;

}

.foot::before{

left: 60px;

}

.foot::after{

right: 60px;

}

一键复制

编辑

Web IDE

原始数据

按行查看

历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值