要删除inline-block元素之间的空间, 请使用margin-right属性。此属性用于删除其右侧元素之间的空间。此属性生成负值以保持靠近其相邻元素。
语法如下:
element {
margin-right:value;
}
例子:
<!DOCTYPE html>
<html>
<head>
<style>
nav a {
display: inline-block;
margin-right:-4px;
background: green;
color:white;
font-weight:bold;
text-decoration:none;
}
h1 {
color:green;
}
body {
text-align:center;
}
</style>
</head>
<body>
<h1>srcmini</h1>
<h2>margin-right:-4px;</h2>
<nav>
<a href = "#"> geeks </a>
<a href = "#"> for </a>
<a href = "#"> geeks </a>
</nav>
</body>
</html>
输出如下:

支持的浏览器:下面列出了CSS margin属性支持的浏览器:
- 苹果Safari 3.1
- 谷歌浏览器4.0
- Firefox 3.0
- Opera 7.6
- Internet Explorer 8.0
来源:
https://www.srcmini02.com/68731.html