How to create a curved speech bubble?

前端 未结 1 437
悲&欢浪女
悲&欢浪女 2020-12-07 02:05

I\'m trying to make a curved speech bubble out of a div, like this:

This is what I\'ve tried, but it doesn\'t really work:

.userMsgBottom{
  po         


        
相关标签:
1条回答
  • 2020-12-07 02:24

    I would consider radial-gradient to do this:

    .userMsgBottom {
      position: relative;
      display: inline-block;
      color:#fff;
      max-width: 260px;
      background-color: #2e7384;
      margin: 12px 8px 0;
      padding: 7px;
      border-radius: 6px;
    }
    
    .userMsgBottom:after {
      content: "";
      position: absolute;
      bottom: 0px;
      right: -23px;
      width: 30px;
      height: 25px;
      background: radial-gradient(circle at top right, transparent 58%, #2e7384 60%);
    }
    <div class="userMsgBottom">
      Some text here<br> Some text here<br> Some text here
    </div>

    0 讨论(0)
提交回复
热议问题