如何使我的div有条件地不根据文本内容进行换行?

时间:2016-09-23 12:15:37

标签: html css

我有一段文字,其中每个单词都包含在div style="display: inline-block; text-align: center;"中。标点符号也包含在这样的div中。

有时标点符号div会在行的开头结束。

如何使用标点符号的div保持前一个div,以便前一个div包含到下一行,所以我没有从一行的开头开始标点符号。

<span id="0" class="sentence">
<div id="0" style="display: inline-block; text-align: center;">
<h3>
<ruby>
1<rt></rt>
</ruby>
</h3>
</div>
<div id="1" style="display: inline-block; text-align: center;">
<h3>
<ruby>
 <rt></rt>
</ruby>
</h3>
</div>
<div id="2" style="display: inline-block; text-align: center;">
<h3>
<ruby>
最初<rt>zuìchū</rt>
</ruby>
</h3>
</div>
<div id="3" style="display: inline-block; text-align: center;">
<h3>
<ruby>
+<rt></rt>
</ruby>
</h3>
</div>
<div id="4" style="display: inline-block; text-align: center;">
<h3>
<ruby>
,<rt></rt>
</ruby>
</h3>
</div>
<div id="5" style="display: inline-block; text-align: center;">
<h3>
<ruby>
上帝<rt>Shàngdì</rt>
</ruby>
</h3>
</div>
<div id="6" style="display: inline-block; text-align: center;">
<h3>
<ruby>
+<rt></rt>
</ruby>
</h3>
</div>
<div id="7" style="display: inline-block; text-align: center;">
<h3>
<ruby>
创造<rt>chuàngzào</rt>
</ruby>
</h3>
</div>
<div id="8" style="display: inline-block; text-align: center;">
<h3>
<ruby>
了<rt>le</rt>
</ruby>
</h3>
</div>
<div id="9" style="display: inline-block; text-align: center;">
<h3>
<ruby>
+<rt></rt>
</ruby>
</h3>
</div>
<div id="10" style="display: inline-block; text-align: center;">
<h3>
<ruby>
天地<rt>tiāndì</rt>
</ruby>
</h3>
</div>
<div id="11" style="display: inline-block; text-align: center;">
<h3>
<ruby>
+<rt></rt>
</ruby>
</h3>
</div>
<div id="12" style="display: inline-block; text-align: center;">
<h3>
<ruby>
。<rt></rt>
</ruby>
</h3>
</div>
</span>
<span id="1" class="sentence">
</span>
</p>
<p id="1">
<span id="0" class="sentence">
<div id="0" style="display: inline-block; text-align: center;">
<h3>
<ruby>
2<rt></rt>
</ruby>
</h3>
</div>
<div id="1" style="display: inline-block; text-align: center;">
<h3>
<ruby>
 <rt></rt>
</ruby>
</h3>
</div>
<div id="2" style="display: inline-block; text-align: center;">
<h3>
<ruby>
大地<rt>dàdì</rt>
</ruby>
</h3>
</div>
<div id="3" style="display: inline-block; text-align: center;">
<h3>
<ruby>
混沌<rt>hùndùn</rt>
</ruby>
</h3>
</div>
<div id="4" style="display: inline-block; text-align: center;">
<h3>
<ruby>
苍茫<rt>cāngmáng</rt>
</ruby>
</h3>
</div>
<div id="5" style="display: inline-block; text-align: center;">
<h3>
<ruby>
,<rt></rt>
</ruby>
</h3>
</div>
<div id="6" style="display: inline-block; text-align: center;">
<h3>
<ruby>
深渊<rt>shēnyuān</rt>
</ruby>
</h3>
</div>
<div id="7" style="display: inline-block; text-align: center;">
<h3>
<ruby>
的<rt>de</rt>
</ruby>
</h3>
</div>
<div id="8" style="display: inline-block; text-align: center;">
<h3>
<ruby>
表面<rt>biǎomiàn</rt>
</ruby>
</h3>
</div>
<div id="9" style="display: inline-block; text-align: center;">
<h3>
<ruby>
一<rt>yī</rt>
</ruby>
</h3>
</div>
<div id="10" style="display: inline-block; text-align: center;">
<h3>
<ruby>
片<rt>piān</rt>
</ruby>
</h3>
</div>
<div id="11" style="display: inline-block; text-align: center;">
<h3>
<ruby>
黑暗<rt>hēiàn</rt>
</ruby>
</h3>
</div>
<div id="12" style="display: inline-block; text-align: center;">
<h3>
<ruby>
+<rt></rt>
</ruby>
</h3>
</div>
<div id="13" style="display: inline-block; text-align: center;">
<h3>
<ruby>
。<rt></rt>
</ruby>
</h3>
</div>
</span>
<span id="1" class="sentence">
<div id="0" style="display: inline-block; text-align: center;">
<h3>
<ruby>
上帝<rt>Shàngdì</rt>
</ruby>
</h3>
</div>
<div id="1" style="display: inline-block; text-align: center;">
<h3>
<ruby>
发出<rt>fāchū</rt>
</ruby>
</h3>
</div>
<div id="2" style="display: inline-block; text-align: center;">
<h3>
<ruby>
的<rt>de</rt>
</ruby>
</h3>
</div>
<div id="3" style="display: inline-block; text-align: center;">
<h3>
<ruby>
动力<rt>dònglì</rt>
</ruby>
</h3>
</div>
<div id="4" style="display: inline-block; text-align: center;">
<h3>
<ruby>
+<rt></rt>
</ruby>
</h3>
</div>
<div id="5" style="display: inline-block; text-align: center;">
<h3>
<ruby>
运行<rt>yùnxíng</rt>
</ruby>
</h3>

0 个答案:

没有答案