只是我在行上有两位文本
Kroppspoäng 和 (sty+kyl)
但是他们已经转移到了不同的线路
<td class="sheet-table-invis2">
<h4 data-i18n="hit-points">Kroppspoäng</h4><h5 data-i18n="strength-agility">(sty+kyl)</h5>
</td>
最佳答案
h4
和 h5
是 block
元素,因此它们的宽度将占据其父元素的宽度并相互堆叠作为行。要将它们彼此内联显示,请将它们设为 inline-block
h4,h5 {
display: inline-block;
}
<td class="sheet-table-invis2">
<h4 data-i18n="hit-points">Kroppspoäng</h4>
<h5 data-i18n="strength-agility">(sty+kyl)</h5>
</td>
您还可以使父级 flex
并且默认方向将是 row
.sheet-table-invis2 {
display: flex;
}
<table>
<td class="sheet-table-invis2">
<h4 data-i18n="hit-points">Kroppspoäng</h4>
<h5 data-i18n="strength-agility">(sty+kyl)</h5>
</td>
</table>
关于css - 我怎样才能让这个文本在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42793546/