答案 0 :(得分:4)
答案 1 :(得分:1)
将float:right
添加到第一个div,float:left
添加到第二个div,并将容器的宽度限制为子项的总宽度
答案 2 :(得分:0)
使用定位。将div的位置都视为绝对。 第二个保留为0,第一个保留为100px;
position:absolute;
left:102px; //whatever needed
两个班级。
答案 3 :(得分:0)
您可以添加浮动:右侧和拇指。但是你可能需要添加第三个外部div来定位这两个。
#container {
background-color: lavender;
}
#outer {
float:left;
width:400;
}
#main {
border: 2px solid green;
height: 300px;
width: 300px;
float:right;
}
#thumbs {
border: 2px solid blue;
height: 100px;
width: 100px;
float:right;
}
<html>
<body>
<div id="container">
<div id="outer">
<div id="main">
1st div
</div>
<div id="thumbs">
2nd div
</div>
<div>
</div>
</body>
</html>