gpt4 book ai didi

html - 为什么字符串会从 Bubble 窗口中伸出来?

转载 作者:太空宇宙 更新时间:2023-11-03 20:52:36 27 4
gpt4 key购买 nike

如果字符串很长,则必须转到下一行。我该怎么做?

Demo

HTML

<div class="chat">

<table>
<tbody>
<tr>
<th>Body</th>
</tr>



<tr id="comment_617">
<td><div class="bubble me"><span class="text-error">01-10 03:29</span>:Person A<br>
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
<form action="/shop/walmart/posts/617" class="button_to" data-remote="true" method="post"><div><input name="_method" value="delete" type="hidden"><input data-confirm="Are you sure?" data-disable-with="deleting..." value="destroy" type="submit"><input name="authenticity_token" value="aoLKQnl4M2SWVlOrXGR+qIMLSeY5m1tKiC/PSnYQjmw=" type="hidden"></div></form>
</div></td>
</tr>




<tr id="comment_615">
<td><div class="bubble me"><span class="text-error">01-10 03:25</span>:Person A<br>
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
<form action="/shop/walmart/posts/615" class="button_to" data-remote="true" method="post"><div><input name="_method" value="delete" type="hidden"><input data-confirm="Are you sure?" data-disable-with="deleting..." value="destroy" type="submit"><input name="authenticity_token" value="aoLKQnl4M2SWVlOrXGR+qIMLSeY5m1tKiC/PSnYQjmw=" type="hidden"></div></form>
</div></td>
</tr>
</tbody>

<div>

CSS

.chat {
width: 400px;
}

.bubble{
background-color: #F2F2F2;
border-radius: 5px;
box-shadow: 0 0 6px #B2B2B2;
display: inline-block;
padding: 10px 18px;
position: relative;
vertical-align: top;
}

.bubble::before {
background-color: #F2F2F2;
content: "\00a0";
display: block;
height: 16px;
position: absolute;
top: 11px;
transform: rotate( 29deg ) skew( -35deg );
-moz-transform: rotate( 29deg ) skew( -35deg );
-ms-transform: rotate( 29deg ) skew( -35deg );
-o-transform: rotate( 29deg ) skew( -35deg );
-webkit-transform: rotate( 29deg ) skew( -35deg );
width: 20px;
}

.me {
float: left;
margin: 5px 45px 5px 5px;
width: 200px;
}

.me::before {
box-shadow: -2px 2px 2px 0 rgba( 178, 178, 178, .4 );
left: -9px;
}

.you {
float: left;
margin: 5px 10px 5px 5px;
width: 200px;
}

.you::before {
box-shadow: 2px -2px 2px 0 rgba( 178, 178, 178, .4 );
right: -9px;
}

最佳答案

将此添加到您的 .bubble 类:

  word-break: break-all;

https://developer.mozilla.org/en-US/docs/CSS/word-break

关于html - 为什么字符串会从 Bubble 窗口中伸出来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14264958/

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