空间没有在html中显示

时间:2018-02-09 05:17:56

标签: html

我不知道这是否是一个基本问题,但我需要问一下。 这是我的问题。当一个用于显示段落的简单HTML代码时, 但它没有达到我希望的正确格式。 我正在下面添加代码。

<p>
Eosinophil count - absolute
An absolute eosinophil count is a blood test that measures the number of white blood cells called eosinophils.
Eosinophils become active when you have certain allergic diseases, infections, and other medical conditions.

How the Test is Performed
Most           of the time blood is drawn from a vein on the inside of the elbow or the back of the hand. The site is cleaned with an antiseptic.
The health care provider wraps an elastic band around your upper arm to make the vein swell with blood.
Next, the provider gently inserts a needle into the vein. The blood collects into an airtight tube attached to the needle.
The elastic band is removed from your arm. The needle is then removed and the site is covered to stop bleeding.

Things to Know
In infants or young children, a sharp tool called a lancet may be used to prick the skin.
The blood collects in a small glass tube, or onto a slide or test strip. A bandage is put on the spot to stop bleeding.

Reference Range

The serum reference ranges of eosinophils are as follows:

    Eosinophils blood (%): 0.0-6.0 (This range may vary slightly in different laboratories.)
    Eosinophil blood count (absolute): 30-350. The percentage of eosinophils is multiplied by the white blood cell count to 
    give the absolute eosinophil count. This range may vary slightly in different laboratories.



ANTIGEN SUSPENSION                    SERUM DILUTION

.                                1:30     1:60    1:120    1:240   
--------------------------------------------------------------------------------

Salmonella Typhi "O"           :  --       --      --       --


Salmonella Typhi "H"           :  --       --      --       --


Salmonella Para Typhi "AH"     :  --       --      --       --


Salmonella Para Typhi "BH"     :  --       --      --       --


</p>

但是在输出中所有空格都被截断了。 如何将确切的文本作为输出?

enter image description here

3 个答案:

答案 0 :(得分:1)

检查css here

中的white-space: pre;属性

&#13;
&#13;
p {
  white-space: pre;
 }
&#13;
<p>
Eosinophil count - absolute
An absolute eosinophil count is a blood test that measures the number of white blood cells called eosinophils.
Eosinophils become active when you have certain allergic diseases, infections, and other medical conditions.

How the Test is Performed
Most           of the time blood is drawn from a vein on the inside of the elbow or the back of the hand. The site is cleaned with an antiseptic.
The health care provider wraps an elastic band around your upper arm to make the vein swell with blood.
Next, the provider gently inserts a needle into the vein. The blood collects into an airtight tube attached to the needle.
The elastic band is removed from your arm. The needle is then removed and the site is covered to stop bleeding.

Things to Know
In infants or young children, a sharp tool called a lancet may be used to prick the skin.
The blood collects in a small glass tube, or onto a slide or test strip. A bandage is put on the spot to stop bleeding.

Reference Range

The serum reference ranges of eosinophils are as follows:

    Eosinophils blood (%): 0.0-6.0 (This range may vary slightly in different laboratories.)
    Eosinophil blood count (absolute): 30-350. The percentage of eosinophils is multiplied by the white blood cell count to 
    give the absolute eosinophil count. This range may vary slightly in different laboratories.



ANTIGEN SUSPENSION                    SERUM DILUTION

.                                1:30     1:60    1:120    1:240   
--------------------------------------------------------------------------------

Salmonella Typhi "O"           :  --       --      --       --


Salmonella Typhi "H"           :  --       --      --       --


Salmonella Para Typhi "AH"     :  --       --      --       --


Salmonella Para Typhi "BH"     :  --       --      --       --


</p>
&#13;
&#13;
&#13;

答案 1 :(得分:1)

在HTML中,多个空格会自动替换为一个空格,除非您的文字被<pre>标记包围。

如果您希望空格位于其他类型的标记中(例如<p>),则需要使用HTML实体。 普通空间的HTML实体为&nbsp;,而标签字符为&tab;。那些像这样的HTML实体很多。以下是查找所需HTML实体的好参考:HTML entities reference chart

答案 2 :(得分:0)

在HTML中使用&amp; nbsp空格