0

我有一个常见问题页面的代码设置,如下所示:

<p><strong>This Is A Question</strong></p>
<p><strong>Answer.</strong> This is the content of the answer, and I am going to keep 
typing until it kicks to a new line.</p>

我确实注意到,当它通过浏览器显示时,新行没有与答案内容的开头对齐。从左对齐。我也知道不要指望 HTML 做这样的事情,必须要问的是。遇到“缩进”此文本本身时,我有什么选择?

任何帮助将不胜感激!

4

3 回答 3

1

我认为这就是你想要的:

<p><strong>This Is A Question</strong></p>
<p><strong style="float:left">Answer.</strong> 
<div style="display:inline-table;float:right">This is the content of the answer, and I am going to keep typing until it kicks to a new line.</div></p>

编辑:从头开始,它适用于 FF + IE,但不适用于 chrome

于 2011-09-17T14:20:31.600 回答
1

Nicole Sullivan 的 css .mediaelement的启发,您可以查看jsfiddle的两列解决方案更新。

于 2011-09-17T14:21:19.963 回答
0

尝试在 CSS 中为段落的 div 使用负填充。通常跨 webkit 和 gecko 工作。

于 2011-09-17T20:10:29.490 回答