如何创建弯曲的气泡?

编程入门 行业动态 更新时间:2024-10-15 06:19:22
本文介绍了如何创建弯曲的气泡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正试图在div中制作一个弯曲的气泡,如下所示:

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{ position: relative; display: inline-block; max-width: 260px; height: auto; word-wrap: break-word; background-color: #2e7384; margin-top: 12px; margin-left: 8px; margin-right: 8px; padding: 7px; border-radius: 6px; } .userMsgBottom:after { content: ""; position: absolute; bottom: 0px; right: 5px; width: 70px; height: 30px; background-color: #2e7384; transform: skew(45deg); transform-origin: top right; border-radius: 0 15% 5% 0% / 25%; z-index: -1; }

它是这样做的:

我该怎么做?

推荐答案

我会考虑radial-gradient来做到这一点:

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>

更多推荐

如何创建弯曲的气泡?

本文发布于:2023-11-04 18:16:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1558664.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:气泡   弯曲

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!