如果文本在一个div中,如何将分隔在多个div中的文本换行?

问题描述 投票:0回答:1
<div style="width: 200px; background-color: lightblue">
<div style="display:flex " >
<div>This is some text.</div><div>This is some text. This is some text.</div>
</div>
</div>

<div style="width: 200px; background-color: lightyellow">
<div style="display:flex " >
<div>This is some text. This is some text. This is some text.</div>
</div>

我正在寻找一种方法来设置浅蓝色 div 中的 div 样式,以便文本看起来像浅黄色 div 中的文本。lightblue and lightyellow div

html css flexbox
1个回答
0
投票
<div style="width: 200px; background-color: lightblue">
<div>
<div style="display:inline ">This is some text.</div><div style="display:inline ">This is some text. This is some text.</div>
</div>
</div>

@temani-afif 提出的解决方案,有效!

© www.soinside.com 2019 - 2024. All rights reserved.