【发布时间】:2010-10-23 01:27:09
【问题描述】:
我似乎无法正确浮动 DIV。我想要实现的是能够将 4 DIV 彼此相邻放置。每个都在 0px 处与顶部对齐,并间隔 30 左右像素,但我不能使用绝对定位。 DIV 的大小根据屏幕大小进行调整。所以,我需要相对定位DIV。当我尝试浮动 DIV 时,它们只是彼此叠放。
这是我到目前为止所拥有的。
<head>
<style type="text/css">
.b1{
position:relative;
margin-left:50px;
float:left;
width:1000px;
height:200px;
background-color:#000;
}
.b4{
position:relative;
top:0px;
left:30px;
float:right;
width:1000px;
height:200px;
background-color:#000;
}
</style>
</head>
<body>
<div class="b1"></div><div class="b1"></div><div class="b1"></div><div class="b4"></div>
</body>
【问题讨论】:
-
4000px 是一种显示分辨率。这是 IMAX 屏幕吗?
-
哈哈哈,不应该垂直滚动。