在我的网页上 http://www.replyonline.co.uk/test/index.html你会看到一个名为#twitter 的 twitter div。
如您所见,它看起来位置不对,需要在其左侧的 4 个#about div 之后,但也需要与其他 div 对齐。它目前看起来被压低了。
我还在所有#about 框周围放置了一个 div,以将它们与 #twitter div 分开。
这是关于框和 twitter 框之一的 CSS:
#about1{
width: 260px;
min-height: 140px;
float: left;
margin: 0 20px 15px 0; background: url(../images/about_grad1.jpg) bottom right;
display: block;
}
#twitter{
width: 220px;
margin-bottom: 20px;
height: 290px;
overflow: auto;
float: right;
font-size: 11px;
background: #ececec;
}
最佳答案
您需要将 twitter div 放在与 4 个关于框相同的 div block 中
应该是
<div>
<div>box1</div>
<div>box2</div>
<div>box3</div>
<div>box4</div>
<div>twitter</div>
</div>
然后将其变薄一点或调整边距。横向空间不够。 如果您将 #twitter 宽度设置为 240,您应该将所有内容都放在一行中,然后进行调整,直到看起来合适。
关于css - DIV 定位不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7902338/