我正在聊天,但我遇到了 CSS 方面的问题。
它是这样的:
这就是我希望的样子:
我该怎么做?
最佳答案
我猜到了标记,但像这样的东西呢 - http://jsfiddle.net/YnPU2/ ?
html:
<p>
<span class="time">20:20:20</span>
<span class="author">quwquu</span>
<span class="text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
</p>
<p>
<span class="time">20:20:22</span>
<span class="author">dfghdg</span>
<span class="text">when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
</p>
CSS:
p { overflow: hidden; vertical-align: top; }
p span { display: table-cell; }
p .time { width: 62px; }
p .author { width: auto; padding-right: 9px; }
p .text { width: auto; }
关于css - 如何在 CSS 中对齐文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14159006/