bob*_*obo 47 html css indentation text-indent
- 在楠格哈尔省Surkhrod地区的一名路透社记者说,村民们说袭击事件发生后,阿富汗警方开始向当地政府大楼投掷石块后向人群开枪.
在上面的段落中,我想使用CSS来使第一行之后的所有行自动缩进一些空格,以便每行在第一行中的 - 之后保持正确.
HTML
<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>
Run Code Online (Sandbox Code Playgroud)
它类似于列表位置设置为外部的列表项,但我不想使用列表.
您能想到实现这种效果的最简单方法是什么?更少的额外HTML标记会更好.
非常感谢大家.
Mat*_*hew 76
你需要text-indent.通常text-indent向内推第一行,但如果你给它一个减号并使用正余量,你可以达到你想要的效果.
text-indent: -10px;
margin-left: 10px
Run Code Online (Sandbox Code Playgroud)