当HTML段落中的文本换行时,用*only* css对齐第一行的第一个非空白字符



我有一段文字如下:

<p>
&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp; In this respect, the conceptual structure of the Act is something like a pyramid. The pyramid shape illustrates the way the income tax law is organised, moving down from the central or core provisions at the top of the pyramid, to general rules of wide application and then to the more specialised topics.
</p>

现在它呈现为:

在这方面,该法案的概念结构有点像金字塔。金字塔形状说明了所得税法的组织方式,从金字塔顶部的中心或核心规定向下移动,到广泛应用的一般规则,然后是更专门的主题。

我想让它像这样呈现:

<>之前在这方面,该法案的概念结构有点像                   金字塔。金字塔形状说明了所得税法的方式有组织,从中央或核心条款的顶部向下移动金字塔,到一般规则的广泛适用,然后到更多                   专业的话题。之前

只使用CSS!

基本信息

我正在转换Markdown文件到HTML。这些文件在源代码控制中。Markdown文件已经为我使用&ensp;字符缩进。我还想要干净的提交日志,所以我想把每个<p>放在一行上。

编辑

以下是Markdown文档中的一个部分的要点:https://gist.github.com/vjpr/5378401

基本上我想要

  • 避免在我的Markdown文档中使用内联html。
  • 允许在GitHub上缩进查看Markdown文档。
  • 允许使用自定义样式表查看相同的Markdown文档,并将段落与第一个非空白字符保持相同的缩进级别,如图所示。

可以同时使用左填充和负缩进,例如

p{
    padding-left:18em;
    border: 1px solid black;
    text-indent :-9em;
}

示例:http://jsfiddle.net/NzUtM/1

可以根据需要随意调整padding和缩进

最新更新