纯CSS实现的一些图标和形状

    .oval {
      width: 200px;
      height: 100px;
      background-color: deepskyblue;
      /* “/”前面的值设置其水平半径,“/”后面值设置其垂直半径 */
      border-radius: 100px / 50px;
    }
椭圆
    .triangle-up,
    .triangle-down,
    .triangle-left,
    .triangle-right {
      display: inline-block;
    }
    /*上三角形*/
    .triangle-up {
      width:  0;
      height: 0;
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
      border-bottom: 50px solid deepskyblue;
    }
    /*下三角形*/
    .triangle-down {
      width:  0;
      height: 0;
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
      border-top: 50px solid deepskyblue;
    }
    /*左三角形*/
    .triangle-left {
      width:  0;
      height: 0;
      border-top: 50px solid transparent;
      border-bottom: 50px solid transparent;
      border-left: 50px solid deepskyblue;
    }
    /*右三角形*/
    .triangle-right {
      width:  0;
      height: 0;
      border-top: 50px solid transparent;
      border-bottom: 50px solid transparent;
      border-right: 50px solid deepskyblue;
    }
上下左右三角形
    .triangle-topLeft,
    .triangle-topRight,
    .triangle-bottomLeft,
    .triangle-bottomRight {
      display: inline-block;
    }
    /*左上角*/
    .triangle-topLeft {
      width: 0;
      height: 0;
      border-top: 100px solid deepskyblue;
      border-right: 100px solid transparent;
    }
    /*右上角*/
    .triangle-topRight {
      width: 0;
      height: 0;
      border-top: 100px solid deepskyblue;
      border-left: 100px solid transparent;
    }
    /*左下角*/
    .triangle-bottomLeft {
      width: 0;
      height: 0;
      border-bottom: 100px solid deepskyblue;
      border-right: 100px solid transparent;
    }
    /*右下角*/
    .triangle-bottomRight {
      width: 0;
      height: 0;
      border-bottom: 100px solid deepskyblue;
      border-left: 100px solid transparent;
    }
左上,右上,左下,右下 角
    /*箭头*/
    .curvedarrow {
      position: relative;
      width: 0;
      height: 0;
      border-top: 27px solid transparent;
      border-right: 27px solid deepskyblue;
      transform: rotate(10deg);
    }
    .curvedarrow:after {
      position: absolute;
      top: -36px;
      left: -27px;
      width: 36px;
      height: 36px;
      content: '';
      border: 0 solid transparent;
      border-top: 6px solid deepskyblue;
      border-radius: 60px 0 0 0;
      transform: rotate(45deg);
    }

箭头
    /*平行四边形*/
    .parallelogram {
      width: 100px;
      height: 100px;
      background-color: deepskyblue;
      transform:  skew(30deg);
    }
平行四边形
    /*梯形*/
    .trapezoid {
      width: 100px;
      height: 0;
      border-right: 25px solid transparent;
      border-bottom: 100px solid deepskyblue;
      border-left: 25px solid transparent;
    }
梯形
    /*五边形*/
    .pentagon {
      position: relative;
      width: 54px;
      border-width: 50px 18px 0;
      border-style: solid;
      border-color: deepskyblue transparent;
      box-sizing: content-box;
    }
    .pentagon:after {
      position: absolute;
      top: -85px;
      left: -18px;
      height: 0;
      width: 0;
      content: '';
      border-width: 0 45px 35px;
      border-style: solid;
      border-color: transparent transparent deepskyblue;
    }
五边形
    /*六边形*/
    .hexagon {
      position: relative;
      width: 100px;
      height: 55px;
      background-color: deepskyblue;
    }
    .hexagon:before,
    .hexagon:after {
      content: '';
      position: absolute;
      left: 0;
      width: 0;
      height: 0;
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
    }
    .hexagon:before {
      top: -25px;
      border-bottom: 25px solid deepskyblue;
    }
    .hexagon:after {
      bottom: -25px;
      border-top: 25px solid deepskyblue;
    }
六边形
    /*爱心*/
    .heart {
      position: relative;
      width: 100px;
      height: 90px;
    }
    .heart:before,
    .heart:after {
      position: absolute;
      left: 50px;
      top: 0;
      width: 50px;
      height: 80px;
      content: '';
      background-color: deepskyblue;
      border-radius: 50px 50px 0 0;
      transform: rotate(-45deg);
      transform-origin: 0 100%;
    }
    .heart:after {
      left: 0;
      transform: rotate(45deg);
      transform-origin: 100% 100%;
    }
爱心
    /*无穷大*/
    .infinity {
      position: relative;
      width: 150px;
      height: 100px;
      box-sizing: content-box;
    }
    .infinity:before,
    .infinity:after {
      position: absolute;
      top: 0;
      left: 0;
      width: 30px;
      height: 30px;
      content: '';
      border: 20px solid deepskyblue;
      border-radius: 50px 50px 0 50px;
      box-sizing: content-box;
      transform: rotate(-45deg);
    }
    .infinity:after {
      left: auto;
      right: 0;
      border-radius: 50px 50px 50px 0;
      transform: rotate(45deg);
    }
无穷大
    /*钻石*/
    .diamond {
      position: relative;
      width: 50px;
      height: 0;
      border-width: 0 25px 25px 25px;
      border-style: solid;
      border-color: transparent transparent deepskyblue transparent;
      box-sizing: content-box;
    }
    .diamond:after {
      position: absolute;
      top: 25px;
      left: -25px;
      width: 0;
      height: 0;
      content: '';
      border-width: 70px 50px 0 50px;
      border-style: solid;
      border-color: deepskyblue transparent transparent transparent;
    }
钻石
    /*锁*/
    .lock {
      position: relative;
      width: 90px;
      height: 65px;
      border: 18px solid deepskyblue;
      border-right-width: 37px;
      border-left-width: 37px;
      border-radius: 10px;
      box-sizing: border-box;
    }
    .lock:before,
    .lock:after {
      position: absolute;
      left: 50%;
      box-sizing: border-box;
      transform: translateX(-50%);
    }
    .lock:before {
      top: -60px;
      width: 70px;
      height: 60px;
      content: '';
      border: 12px solid deepskyblue;
      border-top-left-radius: 35px;
      border-top-right-radius: 35px;
    }
    .lock:after {
      top: -5px;
      width: 25px;
      height: 40px;
      content: '';
      border: 5px solid deepskyblue;
      border-radius: 12px;
    }
    /* 吃豆人 */
    .pacman {
      width: 0;
      height: 0;
      border: 60px solid deepskyblue;
      border-right: 60px solid transparent;
      /*border-left: 60px solid transparent;*/
      border-radius: 60px;
    }
吃豆人
    /* 对话泡泡  */
    .talkbubble {
      position: relative;
      width: 120px;
      height: 80px;
      background-color: deepskyblue;
      border-radius: 10px;
    }
    .talkbubble:before {
      position: absolute;
      top: 26px;
      right: 100%;
      content: '';
      width: 0;
      height: 0;
      border-right: 26px solid deepskyblue;
      border-top: 13px solid transparent;
      border-bottom: 13px solid transparent;
    }
对话泡泡
    /* 太极 */
    .supermepole {
      position: relative;
      width: 96px;
      height: 48px;
      background-color: #FFF;
      border-width: 2px 2px 50px 2px;
      border-style: solid;
      border-radius: 50%;
      box-sizing: content-box;
    }
    .supermepole:before,
    .supermepole:after {
      position: absolute;
      top: 50%;
      content: '';
      width: 12px;
      height: 12px;
      border-radius: 50%;
      box-sizing: content-box;
    }
    .supermepole:before {
      background-color: #FFF;
      left: 0;
      border: 18px solid #000;
    }
    .supermepole:after {
      background-color: #000;
      left: 50%;
      border: 18px solid #FFF;
    }
太极
    /* 丝带徽章 */
    .badge-ribbon {
      position: relative;
      height: 100px;
      width: 100px;
      background-color: deepskyblue;
      border-radius: 50%;
    }
    .badge-ribbon:before,
    .badge-ribbon:after {
      position: absolute;
      top: 70px;
      left: -10px;
      content: '';
      border-right: 40px solid transparent;
      border-left: 40px solid transparent;
      border-bottom: 70px solid deepskyblue;
      transform: rotate(-140deg);
    }
    .badge-ribbon:after {
      right: -10px;
      left: auto;
      transform: rotate(140deg);
    }
丝带徽章
    /* 雪佛兰车标 */
    .chevolet {
      position: relative;
      width: 140px;
      height: 50px;
    }
    .chevolet:before,
    .chevolet:after {
      position: absolute;
      top: 0;
      width: 50%;
      height: 100%;
      background-color: deepskyblue;
      content: '';
    }
    .chevolet:before {
      transform: skew(0deg, 6deg);
    }
    .chevolet:after {
      right: 0;
      transform: skew(0deg, -6deg);
    }
雪佛兰车标
    /* 放大镜 */
    .magnifying-glass {
      position: relative;
      width: 60px;
      height: 60px;
      font-size: 150px;
      border: 10px solid deepskyblue;
      border-radius: 50%;
      box-sizing: content-box;
    }
    .magnifying-glass:before {
      position: absolute;
      right: -40px;
      bottom: -30px;
      width: 60px;
      height: 15px;
      content: '';
      background-color: deepskyblue;
      transform: rotate(45deg);
    }
放大镜
    /* facebook-icon */
    .facebook-icon {
      position: relative;
      width: 100px;
      height: 110px;
      background-color: deepskyblue;
      border: 15px solid deepskyblue;
      border-bottom: 0;
      border-radius: 5px;
      box-sizing: content-box;
      overflow: hidden;
    }
    .facebook-icon:before,
    .facebook-icon:after {
      position: absolute;
      content: '';
      box-sizing: content-box;
    }
    .facebook-icon:before {
      right: -37px;
      bottom: -30px;
      width: 40px;
      height: 90px;
      background-color: deepskyblue;
      border: 20px solid #fff;
      border-radius: 25px;
      box-sizing: content-box;
    }
    .facebook-icon:after {
      top: 50px;
      right: 5px;
      width: 55px;
      height: 20px;
      background-color: #FFF;
    }
facebook图标
    /*  月亮 */
    .moon {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      box-shadow: 15px 15px 0 0 deepskyblue;
    }
月亮
    /* 圆锥 */
    .cone {
      width: 0;
      height: 0;
      border-radius: 50%;
      border-top: 80px solid deepskyblue;
      border-left: 80px solid transparent;
      border-right: 80px solid transparent;
    }
圆锥
    /* 十字架 */
    .cross {
      position: relative;
      width: 20px;
      height: 100px;
      background-color: deepskyblue;
    }
    .cross:before {
      top: 40px;
      left: -40px;
      content: '';
      position: absolute;
      width: 100px;
      height: 20px;
      background-color: deepskyblue;
    }
十字架
    /* 谷堆 */
    .base {
      position: relative;
      width: 100px;
      height: 50px;
      background-color: deepskyblue;
    }
    .base:before {
      position: absolute;
      top: -35px;
      width: 0;
      height: 0;
      content: '';
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
      border-bottom: 35px solid deepskyblue;
    }
谷堆
    /* 指示器 */
    .pointer {
      position: relative;
      width: 120px;
      height: 40px;
      background-color: deepskyblue;
    }
    .pointer:before,
    .pointer:after {
      position: absolute;
      content: '';
      width: 0;
      height: 0;
    }
    .pointer:before {
      left: 0;
      border-top: 20px solid transparent;
      border-bottom: 20px solid transparent;
      border-left: 20px solid #fff;
    }
    .pointer:after {
      right: -20px;
      border-top: 20px solid transparent;
      border-bottom: 20px solid transparent;
      border-left: 20px solid deepskyblue;
    }
指示器
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 158,736评论 4 362
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,167评论 1 291
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,442评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,902评论 0 204
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,302评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,573评论 1 216
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,847评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,562评论 0 197
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,260评论 1 241
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,531评论 2 245
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,021评论 1 258
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,367评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,016评论 3 235
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,068评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,827评论 0 194
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,610评论 2 274
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,514评论 2 269

推荐阅读更多精彩内容