zoukankan      html  css  js  c++  java
  • css3半圆

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style type="text/css">
            div {
                margin-bottom: 30px;
                margin-left: 30px;
            }
    
            /* 上半圆 */
    
            .semi-circle {
                width: 100px;
                height: 50px;
                background-color: #cb18f8;
                border-radius: 50px 50px 0 0;
                /* 左上、右上、右下、左下 */
            }
    
            /* 下半圆 */
    
            .semi-circle2 {
                width: 100px;
                height: 50px;
                background-color: #cb18f8;
                border-radius: 0 0 50px 50px;
                /* 左上、右上、右下、左下 */
            }
    
            /* 左半圆 */
    
            .semi-circle3 {
                width: 50px;
                height: 100px;
                background-color: #cb18f8;
                border-radius: 50px 0 0 50px;
                /* 左上、右上、右下、左下 */
            }
    
            /* 右半圆 */
    
            .semi-circle4 {
                width: 50px;
                height: 100px;
                background-color: #cb18f8;
                border-radius: 0 50px 50px 0;
                /* 左上、右上、右下、左下 */
            }
    
            /* 椭圆 */
    
            .semi-circle5 {
                width: 100px;
                height: 100px;
                border-radius: 100px 0px 100px 0px;
                background: green;
                -webkit-transform: rotate(45deg);
                -ms-transform: rotate(45deg);
                -o-transform: rotate(45deg);
                transform: rotate(45deg);
            }
    
            .semi-circle6 {
                border-radius: 100px 0 0;
                width: 50px;
                height: 50px;
                background-color: aquamarine;
            }
        </style>
    </head>
    
    <body>
        <div class="semi-circle"></div>
        <div class="semi-circle2"></div>
        <div class="semi-circle3"></div>
        <div class="semi-circle4"></div>
        <div class="semi-circle5"></div>
        <div class="semi-circle6"></div>
        <p>扇形原理:左上角是圆角,其余三个角都是直角:左上角的值为宽和高一样的值,其他三个角的值不变(等于0)。</p>
    </body>
    
    </html>

    效果图:

  • 相关阅读:
    php-fpm 进程数的设定
    git如何清除远程 __pycahce__ 文件
    使用docker-compose编写常规的lnmp容器,pdo连接mysql失败。
    composer 巨慢的解决之道
    mysql 单机多实例配置
    golang 在 Mac , Linux , Windows 下交叉编译详解
    mysql 索引优化
    【转】解决深入学习PHP的瓶颈?
    debian 系统搭建rsync+sersync实现实时同步
    docker 搭建debian+nginx+php(含composer的扩展)+mysql+mongo+redis
  • 原文地址:https://www.cnblogs.com/huanghuali/p/9529675.html
Copyright © 2011-2022 走看看