问题是无论chat_ttc
内部是什么,它总是300px。
段:
.chat_ttc {
max-width: 300px;
word-break: break-word;
background: #e5e5e5;
margin-left: 70px;
position: relative;
border-radius: 15px;
border-bottom-left-radius: 0px;
padding: 4px;
padding-left: 6px;
letter-spacing: 0.6;
}

<div class="froma_tc">
<div class="chat_ttc">D</div>
</div>
&#13;
答案 0 :(得分:2)
yaa因为div是块元素,它占用宽度的100% 因为你给出的最大宽度为300px,宽度总是300px
如果你想把一些有效的宽度make div作为inline-block
检查此代码段
.chat_ttc {
max-width: 300px;
display:inline-block;
word-break: break-word;
background: #e5e5e5;
margin-left: 70px;
position: relative;
border-radius: 15px;
border-bottom-left-radius: 0px;
padding: 4px;
padding-left: 6px;
letter-spacing: 0.6;
}
&#13;
<div class="froma_tc">
<div class="chat_ttc">D</div>
</div>
&#13;
希望这有帮助