更新时间:2023-11-22 13:19:58
< 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>