用stylus画可爱的小丸子

之前看了一些关于二次元用css来画卡通图画的文章,都写得非常棒,但是对于我这样一个有密集恐惧症的小白来说相当的头疼,密密麻麻的括弧和标点让人眼花缭乱,最近学习了一些关于stylus的知识,觉得用stylus来写样式相当地简洁,层级嵌套逻辑关系也非常清晰,索性结合Div和stylus画了一个小丸子。话不多说,一起来感受一下stylus的魅力吧...

效果大同小异-_-

我们来看看小丸子身体各部的详细代码

首先是头部html代码

           <div class="hairs"><div class="hair hair1"></div><div class="hair hair2"></div><div class="hair hair3"></div><div class="hair hair4"></div><div class="hair hair5"></div><div class="hair hair6"></div><div class="hair hair7"></div></div><div class="face"><div class="brow left-brow"></div><div class="brow right-brow"></div><div class="eye left-eye"></div><div class="eye right-eye"></div><div class="blusher left-blusher"></div><div class="blusher right-blusher"></div><div class="mouth"></div><div class="ear left-ear"></div><div class="ear right-ear"></div><div class="naek"></div></div>

头部样式

.hairs background base-colorwidth 190pxheight 250pxleft -30pxtop -50pxposition absoluteoverflow hiddenborder-radius 50% 50% 0 0&:aftercontent ''position absolutewidth 300pxheight 200pxbackground #ffef5etop 120px.hairwidth 35pxheight 45pxbackground base-colorposition absolutez-index 1transform rotate(70deg) scale(1) skew(44deg) translate(8px)&.hair1top 17pxleft 27px&.hair2top 8pxleft 52px&.hair3top 4pxleft 73px&.hair4top 0left 90px&.hair5top 4pxleft 108px&.hair6top 8pxleft 125px&.hair7top 17pxright 17px.facebackground #fbdac7width 130pxheight 105pxposition absoluteborder base-bordertop 0border-radius 20px 20px 50px 50px.browwidth 38pxheight 10pxbackground base-colorposition absolutetop 30pxborder-radius 50%&:aftercontent ''width 40pxheight 10pxbackground #fbdac7position absolutetop 1pxborder-radius 50%&.left-browleft 18pxtransform rotate(-10deg)&.right-browright 14pxtransform rotate(10deg).eyewidth 15pxheight 15pxbackground base-colorposition absolutetop 40pxborder-radius 50%&.left-eyeleft 35px   &.right-eyeright 35px.blusherwidth 12pxheight 12pxbackground #f79c99position absolutetop 70pxborder-radius 50%  &.left-blusherleft 10px&.right-blusherright 10px      .mouthwidth 25pxheight 25pxbackground #d96b6eposition absolutetop 60pxleft 52pxborder-radius 50%z-index 1&:after  content ''   height 13pxwidth 25pxbackground #fbdac7position absolute.earwidth 10pxheight 20pxbackground #fbdac7position absolutetop 30pxz-index 2&.left-earleft -11pxborder-radius 5px 0 0 10px&.right-earright -11pxborder-radius 0 5px 10px 0.naekheight 6pxwidth 20pxposition absolutetop 105pxleft 55pxbackground #fbdac7border base-border 

上半身html代码

            <div class="clothes"><div class="collar left-coller"></div><div class="collar right-coller"></div><div class="straps left-straps"></div><div class="straps right-straps"></div></div><div class="arms"><div class="arm left-arm"></div><div class="arm right-arm"></div></div><div class="belt"></div><div class="skirt"><div class="line line1"></div><div class="line line2"></div><div class="line line3"></div><div class="line line4"></div><div class="line line5"></div></div>

上半身样式

.clotheswidth 80pxheight 80pxbackground #ffffffborder  base-borderz-index 2overflow hiddenposition absolutetop 112pxleft 25px border-radius 30% 30% 0 0.collarwidth 20pxheight 10pxz-index 3position absoluteborder 1px solid base-colorbackground #fff&.left-collerleft 17pxtransform rotate(50deg)&.right-collerright 17pxtransform rotate(-50deg).strapsheight 80pxwidth 10pxbackground #e9003az-index 2border 1px solid base-colorposition absolute&.left-strapsleft 17px&.right-strapsright 17px.armwidth  80pxheight 80pxborder-radius 45px border 1px solid base-colorbackground #fffz-index 1overflow hiddenposition absolute&.left-armtop 114px&:after  content ''   width  60pxheight 60pxbackground #ffef5eposition absoluteborder 1px solid base-colortop 9pxleft 10pxborder-radius 30px&.right-armtop 114pxright -130px&:after  content ''   width  60pxheight 60pxbackground #ffef5eposition absoluteborder 1px solid base-colortop 9pxright  10pxborder-radius 30px.beltwidth 80pxheight 20pxbackground #e9003az-index 2border 1px solid base-colorposition absolutetop 193pxleft 25px.skirtwidth 80pxheight 60pxborder-left 50px solid transparentborder-right 50px solid transparentborder-bottom 60px solid #e9003aborder-radius 0 0 50% 50%z-index 0position absolutetop 153pxleft -24px.linewidth 1pxheight 30pxposition absolutebackground #000z-index 3top 75px&.line1left -3pxtransform rotate(20deg)          &.line2left 15pxtransform rotate(10deg)&.line3left 40px            &.line4right 15pxtransform rotate(-10deg)&.line5right -3pxtransform rotate(-20deg)

下身html代码

            <div class="leg"><div class="leg left-leg"></div><div class="leg right-leg"></div></div><div class="stockings"><div class="stockings left-stockings"></div><div class="stockings right-stockings"></div></div> <div class="shoes"><div class="shoes left-shoes"></div><div class="shoes right-shoes"></div></div>          

下身样式

 .legheight 50pxwidth 15pxbackground #fbdac7position absolutetop 130pxz-index -1border 1px solid base-color&.left-legleft 38px&.right-legright -78px&:after  content ''   width  13pxheight 18pxbackground #fffz-index 3border-top 1px solid base-colorposition absolutetop 34pxleft 1px.stockingswidth 30pxheight 15pxbackground #fffposition absolutetop 153pxz-index -2&.left-stockingsleft 20pxtransform rotate(-20deg)border-radius 50% 0 0 50%       &.right-stockingsleft 83pxtransform rotate(20deg)border-radius 0 50% 50% 0.shoeswidth 45pxheight 23pxbackground #a23030position absolutetop 154pxz-index -3&.left-shoesleft 8pxtransform rotate(-20deg)border-radius 50% 0 0 50%       &.right-shoesleft 80pxtransform rotate(20deg)border-radius 0 50% 50% 0

好了,到这里可爱的小丸子就画好了,在样式部分几乎没有了括号之类的标点,这样让人觉得非常清爽,可以说stylus在很大程度上解放css.
知识有限,不足的地方请多包涵,最后希望对您有所帮助,这也是小编乐见的。

【二次元stylus解放css】用stylus画可爱的小丸子相关推荐

  1. pythonturtle画小丸子_【二次元stylus解放css】用stylus画可爱的小丸子

    用stylus画可爱的小丸子 之前看了一些关于二次元用css来画卡通图画的文章,都写得非常棒,但是对于我这样一个有密集恐惧症的小白来说相当的头疼,密密麻麻的括弧和标点让人眼花缭乱,最近学习了一些关于s ...

  2. pythonturtle画小丸子_小丸子成长记---在stylus下用DIV+CSS一步一步打造小丸子

    小丸子成长记 程序员没有对象怎么办? --new 一个呀 但是如果没妹妹呢? --跟母猴子生一个呀 哈哈哈,那么怎么用stylus打造一个天真无邪的小丸子呢? 最后效果(一直有种错觉这是旺仔???) ...

  3. Stylus 学习了解,Stylus ,CSS 和 SCSS 区别

    Stylus 是一个CSS的预处理框架,2010年产生,来自Node.js社区,主要用来给Node项目进行CSS预处理支持,所以 Stylus 是一种新型语言,可以创建健壮的.动态的.富有表现力的CS ...

  4. 20181122——Css的stylus

    Stylus基本使用 在学习一个 Vue.js 项目的过程中,注意到源码中样式的部分并没有用熟悉的 .css 样式文件,而是发现了代码长得和 CSS 相像的 .styl 文件.这个 .styl 以前没 ...

  5. php绘制一个三角形,如何利用css或html5画出一个三角形?两种不同的制作三角形方法(代码实例)...

    我们在平时的前端开发的时候,有时候是需要一些小图形来丰富一下页面效果,比如:下拉列表的倒三角图形.那么这样的一个三角形是如何制作出来的,本章给大家介绍如何利用css或html画出一个三角形?两种不同的 ...

  6. [css] 使用css3画一个扇形

    [css] 使用css3画一个扇形 四个半圆叠加,过半调整 z-index .container { width: 200px; height: 200px; position: relative; ...

  7. [css] 用css3画出一个立体魔方

    [css] 用css3画出一个立体魔方 <!DOCTYPE html> <html> <head><meta charset="utf-8" ...

  8. h5画三角形_如何利用css或html5画出一个三角形?两种不同的制作三角形方法(代码实例)...

    我们在平时的前端开发的时候,有时候是需要一些小图形来丰富一下页面效果,比如:下拉列表的倒三角图形.那么这样的一个三角形是如何制作出来的,本章给大家介绍如何利用css或html画出一个三角形?两种不同的 ...

  9. 运用html画一个三角形,利用css或html5画出一个三角形的方法

    利用css或html5画出一个三角形的方法 发布时间:2020-09-14 14:49:22 来源:亿速云 阅读:83 作者:小新 这篇文章主要介绍利用css或html5画出一个三角形的方法,文中介绍 ...

最新文章

  1. ubuntu18.04.4 没有声音
  2. 德勤预测2018年9大科技趋势:AR走进普通用户,直播仍然是王道
  3. 当PrintForm遇到RPC服务不可用的错误”
  4. 【大学课程】线性代数基础知识点
  5. Linux安装ansible自动化运维工具
  6. 查看zookeeper版本
  7. Impersonate让你的子线程也具有主线程的执行权限
  8. Beta版本冲刺———第二天
  9. mysql函数做条件_MySQL语句优化(三):避免条件字段做函数操作
  10. python 与_Python基础 第一个 Python 程序
  11. 核心参数相近 功能表现不同 联发科MT8389与全志A31s多方位PK
  12. python复数类型及其特点_python中的复数类型
  13. SMAA算法详解 - SMAAEdgeDetectionVS
  14. 如何基于Arduino开发板使用BH1750环境光传感器
  15. nextjs+MDX渲染md文件并生成目录
  16. 蓝桥杯 基础练习 01字串 C/C++/Java/Python描述
  17. 单片机编程软件很简单(22),keil单片机编程软件优化等级+概念解析
  18. VS2010 编写代码时的光标变成了黑块,黑块选中了字,再输入的时候就会替换掉那个黑块选中的字
  19. opencv打开图片转换为二进制
  20. 对对碰c语言程序设计,C语言对对碰游戏源码分享

热门文章

  1. 树莓派 之 系统登陆及设置本地化(简体中文)
  2. Storm InvalidTopologyException: null
  3. 基于TCP(面向连接)的Socket编程
  4. 10 个强大的 Apache 模块
  5. Oracle RMAN CATALOG数据库的配置
  6. 如何寻找outlook邮件附件直接修改保存后的文档
  7. Zookeeper学习总结2
  8. Java 源代码和 C 源代码的运行区别
  9. windows下编译boost
  10. HTML5中关于wheel事件兼容性处理