我希望您能启发我如何将这两个 div(或跨度,如果需要的话)放入另一个 div 中。我需要内部两个 div 的大小是较大容器的一定百分比。它们还需要彼此相邻。我在 web 和 stackoverflow 上尝试了很多不同的解决方案,但似乎仍然无法使其工作。任何人都可以帮忙吗?代码片段如下,我还包括了一个小提琴,以便您更好地看到。
body {
background-color:#f2f2f2;
}
#content {
border:solid;
height:500px;
width:500px;
}
.results {
width:50%;
height:70%;
border: solid;
/*overflow:scroll;overflow-x:hidden;*/
margin-left:7%;
margin-top:5%;
margin-bottom:8%;
}
.map {
width:25%;
height:70%;
border: dotted;
margin-top:5%;
margin-bottom:8%;
float:right;
}
<body>
<div id="content">
<div class="results"></div>
<div class="map"></div>
</div>
</body>
感谢大家的帮助!我希望我的问题足够清楚。