Removing the padding between inline elements

一个人想着一个人 提交于 2019-12-11 03:33:20

问题


I have two span tags that contain content. The first span tag will hold content from the client and the second acts like a "blipping-cursor" (I'm using JavaScript to turn its "display" style from inline to none every 500 milliseconds). Currently, everything works great except for the fact that there is a bit of spacing (just a bit in IE and a TON (one or two spaces worth) in Webkit (nested parenthesis for the win!))) between the content in the first span and the second span.

So my question is simple (well, the question, the answer may or may not be easy), how do I remove this space currently occupying the spot between span one and span two?

Here is a jsFiddle: http://jsfiddle.net/DalexL/6pZB3/

As you can see, there is a highlightable single-space in between the two spans content.

Thanks if you can!


回答1:


Without seeing any code, I'm going to go out on a limb and say that you have a line break in between the two spans:

<span></span>
<span></span>

That will cause a space sometimes. If you get rid of it, the space should go away:

<span></span><span></span>


来源:https://stackoverflow.com/questions/5995930/removing-the-padding-between-inline-elements

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!