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

WBOY
Release: 2016-06-21 09:31:37
Original
1099 people have browsed it

<span>A</span> <span>B</span> <span>C</span>
Copy after login

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


上述结构中,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>
Copy after login

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

擦 上面两位都秒回。。。

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template