DIV定位不正确 [英] DIV positioned incorrectly

查看:114
本文介绍了DIV定位不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页上, http://www.replyonline.co.uk/test /index.html ,你会看到一个名为#twitter的twitter div。

On my webpage over at http://www.replyonline.co.uk/test/index.html you will see a twitter div named #twitter.

如你所见,它看起来不在位置,需要在4 #about divs在它的左边,但也需要与其他人排列。

As you can see, it looks out of position and needs to be after the 4 #about divs to the left of it, but also needs to line up with the others. It looks pushed down currently.

我还在所有的#about框中放了一个div,将它们从#twitter div中分离出来。

I've also put a a div around all of the #about boxes to separate them from the #twitter div.

这是一个关于框和twitter框的CSS:

Here's the CSS for one of the about boxes and the twitter box:

#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;
 }


推荐答案

div在与4个关于框

You need to put the twitter div in the same div block as the 4 about boxes

相同的div区块中。

<div>
  <div>box1</div>
  <div>box2</div>
  <div>box3</div>
  <div>box4</div>
  <div>twitter</div>
</div>

然后减少一点或调整边距。没有足够的水平房间。
如果你将#twitter的宽度设置为240,你应该把一切都放在一行,然后调整,直到它看起来正常。

Then thin it down a little bit or adjust the margins. Not enough horizontal room. If you set the #twitter width to 240 you should get everything on one line, then adjust until it looks ok.

这篇关于DIV定位不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆