在上面的一段中,我想使用CSS使第一行之后的所有行自动缩进一些空格,以便每行在第一行之后保持不变。
<p> - A Reuters reporter in Surkhrod district in Nangarhar province, where
villagers said the raids took place, said Afghan police fired at the crowd
after some of them started throwing stones at local government buildings.</p>它类似于将列表位置设置为外部的列表项,但我不想使用列表。
要达到这个效果,最简单的方法是什么?少一些额外的html标记会更好。
非常感谢你们大家。
发布于 2010-05-14 09:32:39
你需要text-indent。通常情况下,text-indent向内推第一行,但是如果你给它一个负数并使用一个正边距,你就能达到你想要的效果。
text-indent: -10px;
margin-left: 10px发布于 2010-05-14 09:31:35
p {
text-indent: -1em;
padding-left: 1em;
}发布于 2017-01-18 11:27:15
现在无法使用,但是如果您激活了铬上的实验Web平台旗帜,您可以使用text-indent:1em each-line;,它应该完全可以做您想做的事情。
https://stackoverflow.com/questions/2833068
复制相似问题