Home  >  Article  >  Web Front-end  >  span默认margin的问题_html/css_WEB-ITnose

span默认margin的问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:31:371097browse

<span>A</span> <span>B</span> <span>C</span>

 <style type="text/css">        div        {            border: 1px solid red;        }        span        {            border: 1px solid red;        }    </style>


上述结构中,span与span之间显示时候居然有5px的间隙,强制设置span的margin:0无效,请教下,span与span之间5px的间隙这个是什么情况?IE7/8/9和firefox中都有


回复讨论(解决方案)

你不考虑标记间的空格吗?
他们不是也占位吗?

那是空格

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Insert title here</title><style type="text/css">        div        {            border: 1px solid red;        }        span        {            border: 1px solid red;        }    </style></head><body><span>A</span><span>B</span><span>C</span></body></html>

我怎么感觉是因为你留的空格

擦 上面两位都秒回。。。

楼上速度很快,不注意多了空格,晕

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn