我只有一段,换行符很少。我可以在每个文本后缩进吗?
<p>
Some text</br>
More text</br>
More text</br>
</p>
我没有能力把<p></p>
而不是 </br>
并使用 p{text-indent=1em;}
最佳答案
以下适用于 Chrome、Opera 和 Safari。仍在尝试找出适用于 IE 和 Firefox 的解决方案。
此方法假定您知道 br
的最大数量在你的来源中。我正在使用 </br>
就像您所做的那样,根据您的评论,数据库中就是这样。
br {
content: '';
white-space: pre;
}
br:nth-child(1):after {content: '\A ';}
br:nth-child(2):after {content: '\A ';}
br:nth-child(3):after {content: '\A ';}
br:nth-child(4):after {content: '\A ';}
br:nth-child(5):after {content: '\A ';}
br:nth-child(6):after {content: '\A ';}
br:nth-child(7):after {content: '\A ';}
br:nth-child(8):after {content: '\A ';}
br:nth-child(9):after {content: '\A ';}
<p>
Some text</br>
More text</br>
More text</br>
More text</br>
More text</br>
More text</br>
More text</br>
More text</br>
More text</br>
More text</br>
</p>
关于html - 我可以在换行后缩进吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28380972/