What can I use to substitute    in HTML?

2020-05-31 16:59发布

   is ugly, I think.

9条回答
Lonely孤独者°
2楼-- · 2020-05-31 17:02

In CSS try:

white-space:nowrap;
查看更多
走好不送
3楼-- · 2020-05-31 17:11

How about the letter-spacing and/or word-spacing CSS properties?

查看更多
你好瞎i
4楼-- · 2020-05-31 17:11

You should use margin or padding properties with your elements to adjust whitespace.

查看更多
Anthone
5楼-- · 2020-05-31 17:12

You need to use:

   non-breaking space: ' '
   em space: ' '
   en space: ' '
     thin space: ' '

SIX-PER-EM SPACE

<p>I will display &#8198;</p>
<p>I will display &#x2006;</p>

EN QUAD space example

<p>I will display &#8192;tt</p>
<p>I will display &#x2000;tt</p>

EM QUAD

<p>I will display &#8193;tt</p>
<p>I will display &#x2001;tt</p>

Table

Char    Dec Hex Entity  Name
    8192    2000        EN QUAD
    8193    2001        EM QUAD
    8194    2002    &ensp;  EN SPACE
    8195    2003    &emsp;  EM SPACE
    8196    2004        THREE-PER-EM SPACE
    8197    2005        FOUR-PER-EM SPACE
    8198    2006        SIX-PER-EM SPACE
    8199    2007        FIGURE SPACE
    8200    2008        PUNCTUATION SPACE
    8201    2009    &thinsp;    THIN SPACE
    8202    200A        HAIR SPACE
​   8203    200B        ZERO WIDTH SPACE

Basically you can replace 4 space with  

&emsp; == &nbsp;&nbsp;&nbsp;&nbsp;
查看更多
ゆ 、 Hurt°
6楼-- · 2020-05-31 17:16

I had this problem when I realised I will have empty tags. I didn't want to set a fixed height and it was to late to change the html. I wanted to add a space in the css, the substitute for &nbsp, so I added the space before the element, using :before (it needs to be specified via unicode).

p:before {
    content: "\00a0";
}

Hope this solution helps someone. The solution with padding didn't work for my problem.

查看更多
别忘想泡老子
7楼-- · 2020-05-31 17:17

I used a span between two buttons.

<span style="margin-left:70px;"></span>

It spaced everything just where I needed it. I tried creating a "spacer" div, but that pushed one of the buttons below the other. I think that was because I was using a margin-bottom:30px; in the div.

查看更多
登录 后发表回答