CSS实现各种有趣形状

.ti {
        width: 40px;
        height: 100px;
        border: 50px solid red;
        border-color: transparent transparent red transparent;
    }

在这里插入图片描述
1、 梯形原理是设置一个较粗的边框,将上 右 左 设置为透明,将下边颜色填充即可实现
.yuan {
width: 100px;
height: 100px;
border-radius: 50%;
background-color: orange;
}
在这里插入图片描述
2、 这个简单 border-radius 宽高的一半即可实现
.tuoyuan {
width: 200px;
height: 100px;
background-color: darkblue;
border-radius: 50%;
}
在这里插入图片描述
3、椭圆原理是宽是高的一半,或反之也行,形状一样,就是会调一个身位,感兴趣可以试试
.banyuan {
width: 50px;
height: 100px;
background-color: darkcyan;
border-radius: 50px 0 0 50px;
}
在这里插入图片描述
/*4、 半圆原理是半径的 一半数值 */
.muye {
width: 100px;
height: 66px;
background-color: red;
border-radius: 50px 0;
}
在这里插入图片描述
/*5、 根据半圆玩出来的,树叶飞舞之处,火亦生生不息 */
.lingxing {
width: 100px;
height: 100px;
background-color: springgreen;
transform: rotateZ(45deg);
}
在这里插入图片描述
/*6、 菱形,不算太尖,但也能用用 */
.xin {
margin: 50px;
width: 100px;
height: 100px;
transform: rotateZ(45deg);
background: red;
}

    .xin::after,
    .xin::before {
        content: "";
        width: 100%;
        height: 100%;
        border-radius: 50%;
        display: block;
        background: red;
        position: absolute;
        top: -50%;
        left: 0;
    }
    
    .xin::before {
        top: 0;
        left: -50%;
    }

在这里插入图片描述
/* 7、心形由两个圆形和一个矩形进行组合得到的。 我写的最掉头发的一个形状 */

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值