用于在同一行上左对齐和右对齐的跨浏览器 CSS

ina*_*ina 2 css layout cross-browser text-alignment

跨浏览器 CSS 允许在同一行上左对齐和右对齐文本?

示例(其中每个文本引用应分别尽可能向左或向右对齐):

stuff on the right                                              stuff on the left
Run Code Online (Sandbox Code Playgroud)
  • 请不要浮动的答案......除非有一种方法可以使文本不会从多列 css 页面中的父 div/容器中脱离出来......

bar*_*oyd 5

使用容器标签:

<div>
  <p style="float: left">stuff on the left</p>
  <p style="float: right">Tstuff on the right </p>
</div>
Run Code Online (Sandbox Code Playgroud)

使用内联标签:

<div>
  <span style="float: left">stuff on the left</span>
  <span style="float: right">Tstuff on the right</span>
</div>
Run Code Online (Sandbox Code Playgroud)