css3制作图形

  •   顶部弧度

 

.radian {
	width: 100%;
	height: 280rpx;
	background: linear-gradient(to bottom, #f6aa52 0%, #e9594e 100%);
	clip-path: ellipse(100% 100% at 50% 0%);
}
  • 椭圆

 在这里插入图片描述

.oval {
    width: 200px;
    height: 100px;
    background: red;
    border-radius: 100px 50px;
}

  • 三角形

 在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述

在这里插入图片描述在这里插入图片描述、、

// 上三角
.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;
}

// 左上三角
.triangle-top-left {
    width: 0;
    height: 0;
    border-top: 100px solid red;
    border-right: 100px solid transparent;
}

// 右上三角
.triangle-top-right {
    width: 0;
    height: 0;
    border-top: 100px solid red;
    border-left: 100px solid transparent;
}

// 左下三角
.triangle-bottom-left {
    width: 0;
    height: 0;
    border-bottom: 100px solid red;
    border-right: 100px solid transparent;
}

// 右下三角
.triangle-bottom-right {
    width: 0;
    height: 0;
    border-bottom: 100px solid red;
    border-left: 100px solid transparent;
}
  •  气泡

在这里插入图片描述

.bubble{
   width: 120px;
   height: 80px;
   background: red;
   border-radius:  10px;
   position: relative;
}
.bubble:before {
   content:"";
   width: 0;
   height: 0;
   border-top: 13px solid transparent;
   border-right: 26px solid red;
   border-bottom: 13px solid transparent;
   position: absolute;
   right: 100%;
   top: 26px;
}
  •  扇形

在这里插入图片描述

.sector {
   width: 0;
   height: 0;
   border-left: 70px solid transparent;
   border-right: 70px solid transparent;
   border-top: 100px solid red;
   border-radius: 50%;
}
  •  十字

在这里插入图片描述

.cross {
   background: red;
   height: 100px;
   width: 20px;
   position: relative;
}
.cross:after {
   content: "";
   width: 100px;
   height: 20px;
   background: red;
   position: absolute;
   left: -40px;
   top: 40px;
}

横向梯形

.trapezoid_up{
    width:100px;
    height: 0;            
    border-bottom: 20px solid #f40;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
}
.trapezoid_down{
    width:100px;
    height: 0;            
    border-top: 20px solid #000;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
}

 纵向梯形

.trapezoid_right{
    width:0;
    height: 100px;            
    border-left: 20px solid #000;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
}
.trapezoid_left{
    width:0;
    height: 100px;            
    border-right: 20px solid #000;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
}

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

 康 

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值