先来看一下做出来的效果图,然后再来看源代码

是不是还是很像的

下面来看源代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>机器猫</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
.whole {
width: 800px;
margin: 20px auto;
/*border: 2px solid yellow;*/
background-color: white;
position: relative;
}
.head {
margin: 0 auto;
position: relative;
width: 500px;
height: 440px;
background-color: #00b7e7;
border-radius: 220px;
border: 1px solid red;
}
.eye .left_eye,
.eye .right_eye {
width: 100px;
height: 130px;
background-color: white;
border: 2px solid black;
border-radius: 50px;
position: absolute;
top: 50px;
z-index: 3;
}
.eye .LeyeBall,
.eye .ReyeBall {
width: 20px;
height: 20px;
background: black;
border-radius: 10px;
position: absolute;
top: 65px;
}
.eye .left_eye {
left: 146px;
}
.eye .right_eye {
left: 250px;
}
.eye .LeyeBall {
right: 10px;
}
.eye .ReyeBall {
left: 10px;
}
.face {
position: relative;
z-index: 2;
}
.face .feature {
width: 400px;
height: 320px;
border-radius: 160px;
position: absolute;
top: 100px;
left: 50px;
background: white;
}
.face .nose {
width: 45px;
height: 50px;
border-radius: 23px;
background-color: #cf3318;
border: 2px solid black;
position: absolute;
top: 165px;
left: 225px;
z-index: 3;
}
.face .Nline {
width: 3px;
height: 160px;
background: black;
position: absolute;
top: 218px;
left: 248px;
z-index: 3;
}
.face .mouth {
width: 280px;
height: 280px;
border-bottom: 5px solid black;
border-radius: 140px;
position: absolute;
top: 98px;
left: 105px;
}
.face .mustache .MutR_higher {
width: 80px;
height: 2px;
background: black;
position: absolute;
top: 220px;
left: 295px;
z-index: 2;
}
.face .mustache .MutR_middle {
width: 80px;
height: 2px;
background: black;
position: absolute;
top: 240px;
left: 295px;
z-index: 2;
}
.face .mustache .MutR_lower {
width: 80px;
height: 2px;
background: black;
position: absolute;
top: 260px;
left: 295px;
z-index: 2;
}
.face .mustache .MutL_top {
width: 80px;
height: 2px;
background: black;
position: absolute;
top: 220px;
left: 115px;
z-index: 2;
}
.face .mustache .MutL_center {
width: 80px;
height: 2px;
background: black;
position: absolute;
top: 240px;
left: 115px;
z-index: 2;
}
.face .mustache .MutL_bottom {
width: 80px;
height: 2px;
background: black;
position: absolute;
top: 260px;
left: 115px;
z-index: 2;
}
.face .mustache .MutL_bottom,
.face .mustache .MutR_higher {
transform: rotate(160deg);
}
.face .mustache .MutL_top,
.face .mustache .MutR_lower {
transform: rotate(200deg);
}
.neck {
width: 300px;
height: 30px;
background-color: #a31f12;
border: 2px solid black;
border-radius: 15px;
position: relative;
top: 0px;
left: 250px;
z-index: 4;
}
.neck .bell {
width: 60px;
height: 60px;
overflow: hidden;
border: 2px solid black;
border-radius: 60px;
background-color: #cfcb3c;
position: absolute;
top: 5px;
left: 120px;
}
.bell .Bline {
width: 60px;
height: 2px;
background-color: #cfcb3c;
border: 2px solid black;
border-radius: 3px 3px 0 0;
position: absolute;
top: 15px;
}
.bell .Bcircle {
width: 20px;
height: 16px;
background: black;
border-radius: 8px;
position: absolute;
top: 25px;
left: 20px;
}
.bell .Bunderpart {
width: 3px;
height: 20px;
background-color: black;
position: absolute;
left: 28px;
top: 40px;
}
.body {
position: relative;
top: -300px;
z-index: 1;
}
.body .tummy {
width: 280px;
height: 240px;
background-color: #00b1e1;
border: 2px solid black;
position: absolute;
top: 267px;
left: 260px;
}
.body .bellyband {
width: 220px;
height: 220px;
background-color: white;
border: 2px solid black;
border-radius: 110px;
position: absolute;
left: 290px;
top: 267px;
}
.body .pocket {
width: 160px;
height: 160px;
border-radius: 80px;
background-color: white;
border: 2px solid black;
position: absolute;
top: 305px;
left: 320px;
}
.cover {
width: 164px;
height: 80px;
background-color: white;
border-bottom: 2px solid black;
/*border: 5px solid orange;*/
position: absolute;
top: 300px;
left: 320px;
}
.left_hand,
.right_hand {
height: 100px;
width: 100px;
position: absolute;
top: 272px;
left: 248px;
}
.left_hand {
left: -10px;
}
.left_hand .Larm {
width: 70px;
height: 100px;
background-color: #00bee8;
border: 1px solid black;
position: relative;
top: 200px;
left: 535px;
transform: rotateZ(135deg);
/*z-index: -1;*/
}
.right_hand {
left: -10px;
}
.right_hand .Rarm {
width: 70px;
height: 100px;
background-color: #00bee8;
border: 1px solid black;
/*z-index: -1;*/
position: relative;
top: 200px;
left: 215px;
transform: rotateZ(45deg);
}
.left_hand .Lpalm,
.right_hand .Rpalm {
width: 80px;
height: 80px;
border-radius: 40px;
border: 2px solid black;
background-color: white;
position: absolute;
}
.right_hand .Rpalm {
left: 580px;
top: 260px;
z-index: 1;
}
.left_hand .Lpalm {
left: 160px;
top: 260px;
z-index: 1;
}
.foot .left_foot,
.foot .right_foot {
width: 150px;
height: 40px;
background-color: white;
border: 2px solid black;
border-radius: 80px 60px 60px 40px;
position: relative;
}
.foot .left_foot {
left: 240px;
top: 210px;
}
.foot .right_foot {
top: 165px;
left: 410px;
}
.foot .crotch {
width: 40px;
height: 20px;
background-color: white;
border: 2px solid black;
border-bottom: none;
border-radius: 40px 40px 0 0;
position: relative;
top: 103px;
left: 382px;
z-index: 2
}
</style>
</head>
<body>
<div class="wrap">
<div class="whole">
<!-- 头 -->
<div class="head">
<!-- 眼 -->
<div class="eye">
<!-- 左眼 -->
<div class="left_eye">
<!-- 左眼球 -->
<div class="LeyeBall"></div>
</div>
<!-- 右眼 -->
<div class="right_eye">
<!-- 右眼球 -->
<div class="ReyeBall"></div>
</div>
</div>
<!-- 脸 -->
<div class="face">
<!-- 脸型 -->
<div class="feature"></div>
<!-- 鼻 -->
<div class="nose"></div>
<!-- 鼻子线 -->
<div class="Nline"></div>
<!-- 嘴 -->
<div class="mouth"></div>
<!-- 胡子 -->
<div class="mustache">
<div class="MutL_top"></div>
<div class="MutL_center"></div>
<div class="MutL_bottom"></div>
<div class="MutR_higher"></div>
<div class="MutR_middle"></div>
<div class="MutR_lower"></div>
</div>
</div>
</div>
<!-- 脖子 -->
<div class="neck">
<!-- 铃铛 -->
<div class="bell">
<div class="Bline"></div>
<div class="Bcircle"></div>
<div class="Bunderpart"></div>
</div>
</div>
<!-- 身体 -->
<div class="body">
<!-- 肚子 -->
<div class="tummy"></div>
<!-- 肚兜 -->
<div class="bellyband"></div>
<!-- 口袋 -->
<div class="pocket"></div>
<div class="cover"></div>
</div>
<!-- 左手 -->
<div class="left_hand">
<!-- 手臂 -->
<div class="Larm"></div>
<!-- 手掌 -->
<div class="Lpalm"></div>
</div>
<!-- 右手 -->
<div class="right_hand">
<!-- 手臂 -->
<div class="Rarm"></div>
<!-- 手掌 -->
<div class="Rpalm"></div>
</div>
<!-- 脚 -->
<div class="foot">
<!-- 左脚 -->
<div class="left_foot"></div>
<!-- 右脚 -->
<div class="right_foot"></div>
<div class="crotch"></div>
</div>
</div>
</div>
</body>
</html>

其实很简单,都是由一部分一部分拼接起来的,你也来试试吧

用html+css做机器猫 源代码的更多相关文章

  1. 7件你不知道但可以用CSS做的事

    不管你信不信,CSS和JavaScript开始重叠,就像CSS增加了更多功能一新.在我写“你可能不知道的CSS和JavaScript互相影响的5种方式”一文时,人们对于JavaScript和CSS是如 ...

  2. 【CSS】如何用css做一个爱心

    摘要:HTML的标签都比较简单,入门非常的迅速,但是CSS是一个需要我们深度挖掘的东西,里面的很多样式属性掌握几个常用的便可以实现很好看的效果,下面我便教大家如何用CSS做一个爱心. 前期预备知识: ...

  3. 纯css做幻灯片效果

    css3里面有一个@keyframes动画功能. w3c上面的例子: 可以使用它来做一个幻灯片效果. <!DOCTYPE html> <html lang="en" ...

  4. [转载] ul li css 做横向菜单

    原文地址: http://www.cnblogs.com/amylis_chen/archive/2011/09/24/2188398.html 第一步:建立一个无序列表 我们先建立一个无序列表,来建 ...

  5. 如何用css做一个爱心

    摘要:HTML的标签都比较简单,入门非常的迅速,但是CSS是一个需要我们深度挖掘的东西,里面的很多样式属性掌握几个常用的便可以实现很好看的效果,下面我便教大家如何用CSS做一个爱心. 前期预备知识: ...

  6. 纯CSS做3D旋转魔方

    昨天偶然看见网友(简单说 用CSS做一个魔方旋转的效果)做的一个3D旋转魔方  效果就是本博客右侧公告栏所示 在这里把做法展现出来 感兴趣的可以试试  做成自己特有的魔方 <!DOCTYPE h ...

  7. css做旋转相册效果

    css做旋转相册效果 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> &l ...

  8. 用div加css做表格去掉外围边框

    通过div做表格时想加上边框,并且想取点外围边框: <div class="cont"> <div class="row"> <a ...

  9. 利用css做扇形

    html和css每一块的边边角角都是直来直去,除了border-raius,要怎么做扇形了?当然,你如果只想要得到直角扇形,和半圆,那就很简单?那么做小于180的直角扇形,如何做了(大于180的直角无 ...

随机推荐

  1. How To create extension in Hybris(创建Hybris的扩展)

    How To create extension in Hybris What is an extension? An extension is an encapsulated piece of the ...

  2. php操作redis的两个个小脚本

    redis这东西,查询起来没有mysql那么方便,只能自己写脚本了.下面是工作中写的两个小脚本 第一个脚本,查找有lottery|的键,将他们全部删除|打印出来 <?php $redis = n ...

  3. 浅析JS中的堆内存与栈内存

    最近跟着组里的大佬面试碰到这么一个问题, Q:说说var.let.const的区别 A:balabalabalabla... Q:const定义的值能改么? A:你逗我?不能吧 不知道各位看官怎么想? ...

  4. loli的搜索测试-4

    其实这已经是第四次搜索测试了...只不过上两次测试时我不在学校,扔两个链接吧: 测试-2:https://www.luogu.org/blog/user35178/loli-di-sou-suo-ce ...

  5. luogu P3391 【模板】文艺平衡树(Splay)

    嘟嘟嘟 突然觉得splay挺有意思的-- 这道题只有一个任务:区间翻转. 首先应该知道的是,splay和线段树一样,都可以打标记,然后走到每一个节点之前先下传. 那怎么打标记呢?还应该有"区 ...

  6. CMD centos7 安装 最新版本的docker -- dockerfire 原语 ENTRYPOINT - 导入镜像 tar mariadb Dockerfile 构建镜像

    yum update # vim /etc/yum.repos.d/docker.repo //添加以下内容 [dockerrepo] name=Docker Repository baseurl=h ...

  7. CentOS 6.4 编译安装 gcc 4.8.1

    今天在isocpp上看到“GCC 4.8.1 released, C++11 feature complete”这个消息,非常兴奋.终于有一个全面支持C++11语言特性的编译器了! 当然了,gcc仅仅 ...

  8. Java静态方法块、非静态方法块、构造方法、静态方法执行顺序

    示范类StaticTest.java public class StaticTest {     {//只有当创建对象的时候执行         System.out.println("H1 ...

  9. 02_Docker在CentOS 6和CentOS 7下的安装

    CentOS 7 环境下安装docker 安装Docker 检查系统内核是否高于Linux3.10版本 uname -r 使用root权限操作,确保yum包是最新版本 sudo yum update ...

  10. 微信小程序<每日查看>开发总结

    之前一直在做iOS平台的App和SDK开发,发现微信小程序还蛮有意思的,花了将近几天的时间,从看书学习到萌发想法,最后开发出一款小应用,现在花点时间总结一番!作为自我勉励和后续继续学习动力- 先上效果 ...