gpt4 book ai didi

css - 我有 div 掉落的聊天消息

转载 作者:太空宇宙 更新时间:2023-11-04 02:17:05 26 4
gpt4 key购买 nike

我有聊天消息 div,它 floats leftright 但当回复超过一行时,div 会掉下来。

请检查我的codepen div falling down

我想要这个输出:

enter image description here

最佳答案

不要让您的气泡 float ,而是使用左边距。

http://codepen.io/anon/pen/grddmW

编辑:我更新了代码。当然,正确的 float 气泡也是如此。

.message .bubble {
background: #f0f4f7;
font-size: 16px;
padding: 12px 13px;
border-radius: 5px 5px 5px 0px;
color: #717070;
position: relative;
margin-left: 160px;
}

#chat-messages div.message.right .bubble {
border-radius: 5px 5px 0px 5px;
margin-right: 160px;
max-width: 79%;
text-align: right;
}

在这两种情况下,都没有 float ,而是向左/向右留出空白。

关于css - 我有 div 掉落的聊天消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38737640/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com