如何消除这两个分区之间的差距? 我的html代码看起来有点像这样,出于某种原因,它一直在不对准或插入无法控制的差距。

问题描述 投票:0回答:4
#boxes { width:700px; background-color: #ffffff } #boxes1 { width: 350px; float: left; } #boxes2 { width: 350px; float: right; }

这创建了两个块,介于两者之间。我该如何创建它,以使
boxes1

boxes2

的DIV部分之间没有任何边距或差距?
	

将其用于两个盒子。

.boxes {
  width: 50%;
  float: left;
}

这是因为您将您的
html css
4个回答
2
投票
元素漂浮在相反的方向上。

#boxes1 { width: 350px; float: left; } #boxes2 { width: 350px; float: right; }

floothew左右。

#boxes1, #boxes2 { width: 350px; float: left; }

0
投票

您必须将两个盒子浮动到相同的方向,左右或向左。

#boxes1{ width: 350px; float: left; /*or right*/ } #boxes2 { width: 350px; float: left; /*or right*/ }


这应该做需要的事情。

#boxes{ width:700px; background-color: #ffffff } #boxes1{ width: 350px; float: left; } #boxes2 { width: 350px; float: left; }
您可以在这里检查:

0
投票

Http://jsfiddle.net/wbjzw/

    

0
投票
#boxes1{ width: 50%; float: left; #boxes2 { width: 50%; float: left; }

尝试这个...
    

使用这个

#boxes ul { margin:0; padding:0; }

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.