Is there a way to fix a Google map in a div to the screen so that the map on the left side remains fixed while the content on the right side can scroll? I've tried using position:fixed
but it doesn't seem to be working. See the pictures below for reference.
I attempted the following code without success:
#map {
margin-left: -15px;
position: fixed;
top: 0;
}
<div class="mapViewTitle">
<h3>Searching:</h3>
<div class="typeMap">
<p>Single Family Homes</p>
</div>
<div class="priceMap">
<p>From $200,000 to $300,000</p>
</div>
<div class="mapDetail">
<p>3+ br</p>
</div>
<div class="mapDetail">
<p>2+ bth</p>
</div>
</div>
<div class="searchResultsMapRight">
<div class="propertyOverview mapView">
<img src="resources/img/samplePropertyMap1.png" alt=""
class="propertyImage">
<div class="quickDetails">
<p>5689 Main Ave</p>
<p>Los Angeles, CA 90019</p>
<p class="priceDetail">$556,000</p>
</div>
<div class="quickFacts">
<div class="quickFact1">2 br</div>
<div class="quickFact2">2 bth</div>
<div class="quickFact3">4,000 SF</div>
<div class="like mapViewDetail"><i class="fa fa-thumbs-up"></i></div>
</div>
</div>
<div class="propertyOverview mapView">
<img src="resources/img/samplePropertyMap2.png" alt=""
class="propertyImage">
<div class="quickDetails">
<p>5689 Main Ave</p>
<p>Los Angeles, CA 90019</p>
<p class="priceDetail">$556,000</p>
</div>
<div class="quickFacts">
<div class="quickFact1">2 br</div>
<div class="quickFact2">2 bth</div>
<div class="quickFact3">4,000 SF</div>
<div class="like mapViewDetail"><i class="fa fa-thumbs-up"></i></div>
</div>
</div>
<div class="propertyOverview mapView">
<img src="resources/img/samplePropertyMap3.png" alt=""
class="propertyImage">
<div class="quickDetails">
<p>5689 Main Ave</p>
<p>Los Angeles, CA 90019</p>
<p class="priceDetail">$556,000</p>
</div>
<div class="quickFacts">
<div class="quickFact1">2 br</div>
<div class="quickFact2">2 bth</div>
<div class="quickFact3">4,000 SF</div>
<div class="like mapViewDetail"><i class="fa fa-thumbs-up"></i></div>
</div>
</div>
</div>
</div>
</div>
</section>
https://i.stack.imgur.com/we4Zf.jpg
Fixed position but relative to container