CSS:实现矩形边缘有个往里凹的小半圆

在这里插入图片描述
怎样制作如上图形?

首先可以看到是有两个部分组成,左边的小图,和右边往里凹的矩形。
(暂时不说左边的情况了,具体看右边形状的设置)

主要思路:

构建一个矩形,再利用border-radius将他的左边部分设置为往里凹的状态。

具体代码:

<div id="tip-r">
      <dd class="butt"> 我的福利&nbsp;&nbsp;></dd>
      <u style="font-style: normal"></u>
</div>
#tip-r
{
    width:200px;
    height:45px;
    position: relative;
    /*border:1px solid red;*/
}
#tip-r .butt
{
    width:160px;
    height:45px;
    font-size: 16px;
    text-align: center;
    line-height: 45px;
    color:yellow;
    padding-left: 10px;
    margin-left: 30px;
    position:absolute;
    background-color:#e54155;
}
.butt::before
{
    content: "";                //利用这句代码撑开容器
    width: 45px;
    height: 45px;
    background: #FFF;
    position: absolute;
    top:0px;
    left:-22px;
    display: block;
    border-radius:0px 45px 45px 0px;         //来设置往里凹的部分的大小
    font-family: "FontAwesome";
}

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值