用Android写代码,用css写个android机器人代码分享

复制代码代码如下:

 
 

.android{

position: absolute;

left: 500px;

top: 200px;

}

/* head */

.head{

width: 336px;

height: 155px;

background: #a5c63b;

border-radius: 200px 200px 0 0;

position: absolute;

top: -170px;

}

.head:before, .head:after{

background: #a5c63b;

content: '';

width: 10px;

height: 53px;

position: absolute;

top: -30px;

border-radius: 20px 20px 0 0;

}

.head:before{

-webkit-transform: translate(255px, 0px) rotate(30deg);

-moz-transform:translate(255px, 0px) rotate(30deg);

-o-transform:translate(255px, 0px) rotate(30deg);

}

.head:after{

-webkit-transform: translate(63px, 0px) rotate(-30deg);

-moz-transform: translate(63px, 0px) rotate(-30deg);

-o-transform: translate(63px, 0px) rotate(-30deg);

}

/* eyes */

.eyes:before, .eyes:after{

background: #fff;

content: '';

width: 27px;

height: 27px;

top: 68px;

position: absolute;

border-radius: 20px;

}

.eyes:before{

left: 78px;

}

.eyes:after{

right: 78px;

}

/* body */

.body{

width: 336px;

height: 285px;

background: #a5c63b;

border-radius: 0px 0px 30px 30px;

position: absolute;

}

.body:before, .body:after{

background: #a5c63b;

content: '';

width: 75px;

height: 122px;

bottom: -122px;

position: absolute;

border-radius: 0 0 50px 50px;

}

.body:before{

left: 68px;

}

.body:after{

right: 68px;

}

/* arms */

.arms:before, .arms:after{

background: #a5c63b;

content: '';

width: 75px;

height: 233px;

top:-8px;

position: absolute;

border-radius: 40px;

}

.arms:before{

left: -90px;

}

.arms:after{

right: -90px;

}

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
在Visual Studio Code (VS Code) 中制作一个响应式的安卓机器人图标网页,你可以使用HTML、CSS和JavaScript。这里是一个简单的步骤说明: 1. **创建项目结构**: - 创建一个新的文件夹,例如`robot-resp-web`。 - 在这个文件夹下,新建三个文件:`index.html`, `style.css`, 和 `script.js`。 2. **编HTML** (`index.html`): ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="style.css"> <title>Android Robot Icon</title> </head> <body> <div class="robot-container"> <img src="android_robot_icon.png" id="robot-img" alt="Android Robot Icon"> </div> <script src="script.js"></script> </body> </html> ``` 3. **样式设计** (`style.css`): ```css .robot-container { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f5f5f5; } @media screen and (max-width: 600px) { .robot-container img { width: 70%; } } ``` 4. **添加交互效果** (`script.js`,如果需要动画或点击事件可以在此处添加): ```javascript // 示例:点击放大图标 document.getElementById('robot-img').addEventListener('click', function() { this.classList.toggle('zoomed'); }); ``` 在CSS中,`.zoomed`类可以设置图片放大的样式,如`transform: scale(1.1);`. 记得替换`android_robot_icon.png`为实际的安卓机器人图标路径。 完成以上步骤后,当你在不同尺寸的设备上打开`index.html`,你会看到一个响应式的安卓机器人图标,图标大小会根据屏幕宽度自动调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值