我该如何在同一行中将文本与左边的文本和右边的文本对齐? [英] How may I align text to the left and text to the right in the same line?
本文介绍了我该如何在同一行中将文本与左边的文本和右边的文本对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何对齐文本,使其中的一部分与左侧对齐,并且其中的一部分与同一行中的右侧对齐?
< p>这段文字应该左对齐。这段文字应该对齐。< / p>
我可以将所有文本对齐到左侧(或右侧),可以直接内联,或使用样式表 -
< p style ='text-align:left'>这段文字应该是left-对齐。
此文本应该右对齐。< / p>
如何将相应的文本左右对齐,同时保持相同线?
解决方案
< p style = text-align:left;>此文本左对齐< span style =float:right;>此文本右对齐< / span>< / p> pre>
https://jsfiddle.net/gionaf/5z3ec48r/
How can I align text so that some of it aligns to the left and some of it aligns to the right within the same line?
<p>This text should be left-aligned. This text should be right aligned.</p>
I can align all of the text to the left (or to the right), either directly inline, or by using a stylesheet -
<p style='text-align: left'>This text should be left-aligned.
This text should be right aligned.</p>
How can I align the corresponding text to the left and to the right, while keeping it on the same line?
解决方案
<p style="text-align:left;">
This text is left aligned
<span style="float:right;">This text is right aligned</span>
</p>
https://jsfiddle.net/gionaf/5z3ec48r/
这篇关于我该如何在同一行中将文本与左边的文本和右边的文本对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文