用CSS去掉两个div中间的空白

html-css016

用CSS去掉两个div中间的空白,第1张

<!-- 这样试试 --><font face="Arial, Helvetica, sans-serif"></font><html>

<head>

<title>1x</title>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312">

<style type="text/css">

body

.table{

white-space:nowrap;

position:relative

width:1003px

height:auto

border:none

z-index:auto}.mdiv{

width:1003px

height:auto

overflow:hidden

clear:both

}.left{

float:left

width:100px

height:914px

overflow:hidden

clear:left

}.right{

float:right

width:100px

height:914px

overflow:hidden

clear:right

}.middle{

float:left

width:803px

height:914px

}.floor{

width:1003px

height:auto}

</style>

</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<!-- ImageReady Slices (1x.psd) --><div class="table">

<!--顶层-->

<div class="mdiv"><img src="images/1x_01.gif" class="1x_01" width="1003px"></div>

<!--中间-->

<div class="table"><img src="images/1x_09.gif" width="1003px" height="9" alt=""></div>

<div class="left"><img src="images/1x_02.gif" width="100px" height="914" alt=""></div>

<div class="middle"><img src="images/1x_04.gif" width="803" height="379" alt=""></div>

<div class="right"><img src="images/1x_05.gif" width="100px" height="914" alt=""></div>

<!--底层-->

<div class="floor"><img src="images/1x_23.gif" width="1003px"></div>

</div>

<!-- End ImageReady Slices -->

</body>

</html>

第一种办法:你改这么写(最简单的一种):<a>1</a><a>2</a><a>3</a><a>4</a>,就是A标签之间不换行不加空格

第二种办法:如果你非要换行这种写法:

这么改(这种写法,在ie6中还是稍微有点间隙,但是在别浏览器中都正常):

a{display:inline-blockwidth:27pxheight:27pxtext-align:center}

.nav{font-size:0}

.nav a{font-size:12px}

<div class="nav">

<a>1</a>

<a>2</a>

<a>3</a>

<a>4</a>

<div>