zoukankan      html  css  js  c++  java
  • 纯css实现三角形

    在设计界面的时候,通常需要三角形的图标,一般做法是用图片,其实也可以使用css来实现。如下:


    向上的三角形

     

    向右的三角形

     

    向下的三角形

     

    向左的三角形

     

    实现它们的css分别是:

    1 .top{
    2     width: 0;
    3     height: 0;
    4     border-color: transparent transparent #333 transparent;
    5     border-width: 6px;
    6     border-style: solid;
    7 }
    1 .right {
    2     width: 0;
    3     height: 0;
    4     border-color: transparent transparent transparent #333;
    5     border-width: 6px;
    6     border-style: solid;
    7 }
    1 .down {
    2     width: 0;
    3     height: 0;
    4     border-color: #333 transparent transparent transparent;
    5     border-width: 6px;
    6     border-style: solid;
    7 }
    1 .left {
    2     width: 0;
    3     height: 0;
    4     border-color: transparent #333 transparent transparent;
    5     border-width: 6px;
    6     border-style: solid;
    7 }

    其中用到的border-color:transparent是只有在奇葩的IE6下才支持,所以可以放心使用

  • 相关阅读:
    Java Output流写入包装问题
    SpringBoot项目单元测试不经过过滤器问题
    SpringSecurity集成启动报 In the composition of all global method configuration, no annotation support was actually activated 异常
    JWT jti和kid属性的说明
    Maven 排除依赖
    第五章 基因概念的发现
    第三章 孟德尔遗传的拓展
    第二章 孟德尔遗传
    第一章 引言
    GWAS全基因组关联分析
  • 原文地址:https://www.cnblogs.com/dacuotecuo/p/3854501.html
Copyright © 2011-2022 走看看