在这里,我有一种情况,我想使我的map well成为fixed大小。
下面是一个jsfiddle:https://jsfiddle.net/x4gM4/36/ (请滚动以注意我正在尝试的东西)
我试过你在jsfiddle上看到的东西,请帮我把我的map变成fixed sized
这里是我的主div
<div class="row"> <!-- start of row -->
<div class="col-sm-6">
<div class="well"> 4 images goes here </div>
</div>
<!-- google map goes here, whom i want to be fixed -->
<div class="col-sm-6">
<div class="well">
google Map
</div>
</div>
</div> <!-- end of one row -->问题:我想让google map well和scrolling images作对
如图所示,请制作小提琴大小。

请提前帮我谢谢!
发布于 2017-06-29 10:16:09
我相信这就是你所需要的。
div.fixed-map {
position: relative;
}
div.fixed-map > div.well {
position: fixed;
}发布于 2017-06-29 10:17:06
你需要position: fixed
#map-canvas {
height: 100%;
width: 300px;
background-color: #CCC;
position: fixed;
right: 0;
top: 0;
}然而,您需要设置相对于整个窗口,而不仅仅是父div的右边和顶部位置。
https://stackoverflow.com/questions/44822288
复制相似问题