我需要对齐 3 个 div 并排浮动。下面是我的代码,但是所有 DIV 都出现在彼此下方,我猜这是因为固定位置。然而,这是我的网站需要的定位。
.one 是我希望有一个最小宽度的侧链接栏: 150 像素 .two 用于广告和说明链接 .three 是一个长 div 填充需要可滚动的数据。我尝试了可能的方法,但 jquery 没有任何帮助?我希望所有人都处于固定位置。当窗口最小化时,我还希望 DIV 保持相同的大小。
谢谢
<!DOCTYPE html>
<html>
<head>
<style>
.one {
height:50px;
width:34%;
float:left;
background-color:red;
position:fixed;
}
.two {
height:50px;
width:33%;
float:left;
background-color:blue;
position:fixed;
}
.three{
height:50px;
width:33%;
float:left;
background-color:green;
position:fixed;
overflow:scroll;
}
</style>
</head>
<body>
<div class="one">one</div>
<div class="two">two</div>
<div class="three">three</div>
</body>
</html>
继续编辑:
我能够将 DIVS 分开,但随后窗口最小化,.two div 浮动在 .one div 上。见图片https://postimg.cc/kDQSJpDR
.one {
height:50px;
width:33%;
float:left;
background-color:red;
position:fixed;
min-width:200px;
}
.two {
height:50px;
width:33%;
margin-left: 34%;
float:left;
background-color:blue;
position:fixed;
}
.three{
height:50px;
width:33%;
margin-left: 68%;
float:left;
background-color:green;
position:fixed;
overflow:scroll;
}