如何在HTML中换行后避免缩进

时间:2013-05-01 07:42:42

标签: html web

我有以下HTML正文:

<a name="milosz"><h2>Learning</h2></a>
To believe you are magnificent.  <br>&nbsp;
And gradually to discover that you are not magnificent.<br>&nbsp;  
Enough labor for one human life.<br>&nbsp;
<br>&nbsp;
<br>

在网页中,它显示如下:

To believe you are magnificent.  
 And gradually to discover that you are not magnificent.  
 Enough labor for one human life.

请注意,从第二行开始,句子缩进。 有没有办法避免这种缩进?

3 个答案:

答案 0 :(得分:5)

使用<br>的换行符时,您会开始另一行。当跟随空格&nbsp;(空间的ASCII值)时,自然会以空格开始新行。请尝试删除&nbsp;

您的案例

代码

First line<br>&nbsp;
Second line

结果

First line
 Second line

<强>解决方案

代码

First line<br>
Second line

结果

First line
Second line

答案 1 :(得分:1)

<br> -- Line Break (New Line)
&nbsp; -- For Blank Space

你已经在每一行的末尾写了这个用于新行(换行符),对于缩进你用&nbsp;这是空格

所以删除
并将其保持在一行。

答案 2 :(得分:1)

使用预标记Like 打开(预)标签 甲 您 想 显示 关闭(预)标签