2015-09-06 65 views
-2

我正在写一个故事,当我完成一章后,我将它放在HTML文件中以获得乐趣。我一直在为每个段落使用段落标记。但我有很多段落,还有更多。我来问这是否有更简单的方法。愿意使用CSS。是否有更简单的方法来制作段落? (Html)

+0

你可以用降价来编写代码。 –

+0

甚至不知道那是什么...... – Dan

+0

这与您用于输入此问题的内容是一样的。 –

回答

3

这不是一个编程问题,但仍然是,因为我知道我正在回答它的答案。你在找什么,Markdown

Markdown是一种维基语法,专门用于富文本内容。所以,现在,由于您在编写太多段落时遇到问题,Markdown可以轻松地将所有双行换行转换为段落。 。

对于例如,考虑下面的文字:

Pages that you view in incognito tabs won’t stick around in your browser’s history, cookie store or search history after you’ve closed all of your incognito tabs. Any files that you download or bookmarks that you create will be kept. 

Going incognito doesn’t hide your browsing from your employer, your internet service provider or the websites that you visit. 

你可以看到有字kept.经过两次换行。这将在浏览器中呈现,当你输入上面的文字在降价转换器,这样一来:

<p>Pages that you view in incognito tabs won’t stick around in your browser’s history, cookie store or search history after you’ve closed all of your incognito tabs. Any files that you download or bookmarks that you create will be kept.</p> 
<p>Going incognito doesn’t hide your browsing from your employer, your internet service provider or the websites that you visit.</p> 
+1

这不是我的意思,但无论如何,谢谢。 – Dan

+0

@丹告诉我更多。我准备好帮助你。或者你可能正在寻找'白色空间:预包装;'。 –

+1

Markdown:更容易// 乳胶:更好但更复杂 – Fundhor

1

取决于你对演示如何挑剔,你可以考虑......

环绕整个事情
<div style="white-space: pre-wrap"> 
Epic story of epic unicorn epicness! 
</div> 

这将保留所有空格,不仅仅是换行符,而且还包含单词之间的空格。这意味着如果你的文本中有很大的空间(通过印刷术或其他方式传达暂停),那么你只需输入一堆空格就行了。

但是,你不会有控制空间还有多大的段落之间,比通过添加更多的新行等的能力。你无法像使用段落那样创建任何大小的空间。考虑你需要什么并选择一个行动方案。

就个人而言,我会使用记事本+ +(或类似的编辑器),并做了“查找和替换”所有的正则表达式(.+)<p>\1<\/p>

相关问题