接着之前的[css]我要用css画幅画(三), 今天,我画了两朵云,并给小明介绍了个朋友:静静。

github:https://github.com/bee0060/Css-Paint , 完整代码在pages/sun-house-4.html和相关的css中可以找到

demo: http://bee0060.github.io/Css-Paint/pages/sun-house/sun-house-4.html

完整html如下:

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Css Paint</title>
<link rel="stylesheet" type="text/css" href="../css/sun.css" />
<link rel="stylesheet" type="text/css" href="../css/house.css" />
<link rel="stylesheet" type="text/css" href="../css/human.css" />
<link rel="stylesheet" type="text/css" href="../css/cloud.css" />
</head>
<body>
<div class="sun">
<div class="sun-body"></div>
<div class="sun-shine-light sun-shine-light1"></div>
<div class="sun-shine-light sun-shine-light2"></div>
<div class="sun-shine-light sun-shine-light3"></div>
<div class="sun-shine-light sun-shine-light4"></div>
<div class="sun-shine-light sun-shine-light5"></div>
</div> <div class="house-width house">
<div class="house-width house-roof house-roof-left"></div>
<div class="house-width house-roof house-roof-right"></div>
<div class="house-width house-wall"> <div class="house-wall-door"> <div class="house-wall-door-handle"></div>
</div>
</div>
</div> <div class="human human-pos-1">
<p class="lines">大家好,我叫小明</p>
<div class="human-head-normal"></div>
<div class="human-body-normal"></div>
<div class="human-arms-normal"></div>
<div class="human-legs-normal"></div>
</div> <div class="human human-pos-2">
<p class="lines">大家好,我叫静静</p>
<div class="human-head-normal"></div>
<div class="human-body-normal"></div>
<div class="human-arms-normal"></div>
<div class="human-legs-1"></div>
</div> <div class="cloud cloud-pos cloud-pos-1">
<div class="cloud-pos cloud-border cloud-bg cloud-top"></div>
<div class="cloud-pos cloud-border cloud-bg cloud-left"></div>
<div class="cloud-pos cloud-border cloud-bg cloud-right"></div>
<div class="cloud-pos cloud-border cloud-bg cloud-bottom"></div>
</div>
<div class="cloud cloud-pos cloud-pos-2">
<div class="cloud-pos cloud-border cloud-bg cloud-top"></div>
<div class="cloud-pos cloud-border cloud-bg cloud-left"></div>
<div class="cloud-pos cloud-border cloud-bg cloud-right"></div>
<div class="cloud-pos cloud-border cloud-bg cloud-bottom"></div>
</div> </body>
</html>

Html

本次对human.css做了一些改动,主要增加了如下内容:

 .human-pos-1 {
left: 250px;
bottom: 25px;
} .human-pos-2 {
left: 40px;
bottom: 60px;
} .human-legs-1 {
border: 3px solid #000;
border-bottom: none;
border-right: none;
height:50px;
left: 55px;
position: absolute;
top: 120px;
width: 50px; -webkit-transform: rotate(-2deg);
-webkit-transform-origin: 1px 1px;
}

human.css改动

云的css如下:

 .cloud{
height: 150px;
width: 250px;
} .cloud-pos {
position: absolute;
} .cloud-pos-1 {
left: 35%;
top: 25px;
} .cloud-pos-2 {
left: 60%;
top: 25px;
} .cloud-bg {
background-color: skyBlue;
} .cloud-border {
border: 2px solid #000;
} .cloud-top {
border-radius: 100%;
border-width: 0px;
height: 100px;
left: 50%;
margin-left:-75px;
width: 150px;
} .cloud-left {
border-radius: 100%;
border-width: 0px;
height: 100px;
margin-top: -50px;
top: 60%;
width: 100px;
} .cloud-right {
border-radius: 100%;
border-width: 0px;
height: 100px;
margin-top: -50px;
right:;
top: 60%;
width: 100px;
}
.cloud-bottom {
border-radius: 100%;
border-width: 0px;
height: 100px;
left:53%;
margin-left: -75px;
margin-top: -50px;
top: 65%;
width: 150px;
}

cloud.css

这里并没有用到什么陌生的css,一个发现是,原来还有skyBlue这个颜色。

这里的云是由四个形状不一的圆组成, 主要用了圆角属性和位置属性。

在画完后,也特意查了以下MDN中border-radius的详细介绍,加深了解,这里奉上MDN的文档链接(内容较多,再转述觉得多余,也担心造成误导,直接看文档可能更好):

https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-radius

非常详细,发现自己以前用的还是比较浅的。

今天就到这,谢谢观看。 如有错误,欢迎指正。

PS: 这次去掉了code pen的demo,因为code pen每次都要把多个css文件中的代码逐个复制进去,比较麻烦。 但如果看官觉得有code pen看起来效果更好,可以留言告诉我,我再加回去。

[css]我要用css画幅画(四)的更多相关文章

  1. [css]我要用css画幅画(五)

    接着之前的[css]我要用css画幅画(四), 这次我给小明和静静增加了对话,用了简单的动画效果. github:https://github.com/bee0060/Css-Paint , 完整代码 ...

  2. [css]我要用css画幅画(三)

    接着之前的[css]我要用css画幅画(二), 今天,我画了一个小人,他的名字暂时叫作小明. 以下只列出本次修改增加的内容 html如下: <div class="human left ...

  3. [css]我要用css画幅画(六)

    接着之前的[css]我要用css画幅画(五), 由于这个画已经画了很久了,这次一次性加了比较多更新,算是让这幅画告一段落吧. 本次的更新包括: 1. 给云增加动画 2. 画了一棵树 3. 树上画了一个 ...

  4. [css]我要用css画幅画(九) - Apple Logo

    接着之前的[css]我要用css画幅画(八) - Hello Kitty,这次画的是苹果公司的logo 这次打算将分析和实现步骤尽量详细的说一说. 其实之前的也打算详细讲分析和设计过程,不过之前的图比 ...

  5. [css]我要用css画幅画(八) - Hello Kitty

    接着之前的[css]我要用css画幅画(七) - 哆啦A梦,这次画的是Hello Kitty. /* 开始前先说点废话, 一转眼就2016年了,过完年后一直没更新博客,无他,就是懒得动. 这一转眼,一 ...

  6. [css]我要用css画幅画(七) - 哆啦A梦

    接着之前的[css]我要用css画幅画(六),今天画的有所不同,画的是哆啦A梦,我们小时候对他的称呼其实是小叮当机器猫. (PS:这次我要做的事情,很多人已经做过,这并不是什么创新,我只是在学习并记录 ...

  7. [css]我要用css画幅画(二)

    接着之前的[css]我要用css画幅画(一) , 今天,我又画一个房子,很简单,屋顶.墙壁.门. 现在开始,做得效果都只兼容chrome,所以下面的css3的属性可能只有-webkit-前缀. 我只是 ...

  8. [css]我要用css画幅画(一)

    几年前开始就一直想用css画幅画. 今天才真正开始, 从简单的开始. 作为一个工作压力那么大的程序员,我首先要画一个太阳. html如下: <!DOCTYPE html> <html ...

  9. 【CSS学习笔记】a标签的四种伪类

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xht ...

随机推荐

  1. 关于Docker官方CentOS镜像无法启动mysqld的总结

    很多童鞋反映,在Docker官方CentOS镜像中安装了Mysql server后,无法正常启动. 无法正常启动表现为两种情况: 1> 初始完数据库后,mysqld启动报错 2> syst ...

  2. 为SharePoint 站点添加通知

    作为思想.内容的共享型产品,SharePoint 不出意外的成为其中最好用的产品之一,想想平时在公司中接到通知并了解通知内容是件很平常的事情,那让这种平常的事情进入到SharePoint中可以通过如下 ...

  3. C++基础知识

    基础知识 &&和||具有"短路"特性,特别是在第二个操作数有++或--时要注意. 显式类型转换 (类型说明符)表达式 //C风格的 类型说明符(表达式) //cpp ...

  4. 深入seajs源码系列三

    入口方法 每个程序都有个入口方法,类似于c的main函数,seajs也不例外.系列一的demo在首页使用了seajs.use(),这便是入口方法.入口方法可以接受2个参数,第一个参数为模块名称,第二个 ...

  5. java之文件基本操作

    java之文件基本操作 1 使用 BufferedReader 在控制台读取字符 public static void readChar() throws IOException{ char c; I ...

  6. 浅谈2D游戏设计模式3 - 冒险地图之美(1)

    冒险岛之所以能长久的存在,很大一部分原因是因为它的美工设计的非常的精细,以及独特,那么独特以及美究竟体现在哪些方面呢? 今天我就带大家来分析几幅地图吧. 好吧,我们就拿上面这幅美景来分析吧. 1.阳光 ...

  7. JSP自定义tag

    前端需要调用后端的配置,想起velocity-tools.然而jsp的话,目前只能想到tag和EL表达式了. Tag相当好写,jsp2.0提供了简化写法: 编写一个java类: public clas ...

  8. ABySS非root权限安装

    本文转自  http://yangl.net/2015/11/12/abyss_install/ ABySS: ABySS is a de novo, parallel, paired-end seq ...

  9. No.006:ZigZag Conversion

    问题: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows l ...

  10. python征程1.1(初识python)

    在学习python前必须要掌握的一些基本知识   1.编程语言 2.python   .  C#   JAVA 3.python:  pypy    cpython     jpython 4.执行方 ...