zoukankan      html  css  js  c++  java
  • 用CSS绘制最常见的形状和图形

    #rectangle {
        width: 200px;
        height: 100px;
        background: red;
    }

    #circle {
        width: 100px;
        height: 100px;
        background: red;
        -moz-border-radius: 50px;
        -webkit-border-radius: 50px;
        border-radius: 50px;
    }
    
    /* 可以使用百分比值(大于50%),但是低版本的Android不支持 */

    #oval {
        width: 200px;
        height: 100px;
        background: red;
        -moz-border-radius: 100px / 50px;
        -webkit-border-radius: 100px / 50px;
        border-radius: 100px / 50px;
    }
    
    /* 可以使用百分比值(大于50%),但是低版本的Android不支持 */

    #triangle-up {
        width: 0;
        height: 0;
        border-left: 50px solid transparent;
        border-right: 50px solid transparent;
        border-bottom: 100px solid red;
    }

    #triangle-down {
        width: 0;
        height: 0;
        border-left: 50px solid transparent;
        border-right: 50px solid transparent;
        border-top: 100px solid red;
    }

    #triangle-left {
        width: 0;
        height: 0;
        border-top: 50px solid transparent;
        border-right: 100px solid red;
        border-bottom: 50px solid transparent;
    }

    #triangle-right {
        width: 0;
        height: 0;
        border-top: 50px solid transparent;
        border-left: 100px solid red;
        border-bottom: 50px solid transparent;
    }
  • 相关阅读:
    1649. 超级棒棒糖
    1872. 连接棒材的最低费用
    二叉树的层级遍历转换
    ZMQ的三种消息模式
    logging日志
    Svn基本使用
    Pycharm快捷键
    Redis安装和连接
    整形转中文
    C# Socket连接 无法访问已释放的对象
  • 原文地址:https://www.cnblogs.com/baiyygynui/p/5983500.html
Copyright © 2011-2022 走看看