I am working on a website project involving a full screen Google Maps element on the index page. I am trying to add the logo on the right and make it sticky, so as users scroll down, it stays in place.
However, once I set the container of the logo element to sticky, and the logo inside to be displayed as block, altough it works, it created a white line on the top of the page too, pushing down the Google Maps element
Here's an image about the issue, with elements pushed down:
The HTML looks like this:
<body style="position: relative;">
<div class="titleText" style="position: relative;">
<div id="smallh">Country,</div>
<div class="title">XYZ</div>
<div class="h">Soon</div>
</div>
<div class="sticky"><div style="border: 1px solid aquamarine"><img src="logo.png"></div></div>
<div id="map"></div>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=APIKEY&callback=initMap®ion=hu">
</script>
</html>
</body>
CSS looks like the following:
div.sticky{
position: -webkit-sticky;
position: sticky;
top: 0;
padding: 5px;
width: 60px;
float: right;
font-size: 20px;
z-index: 999;
}
img {
width: 60px;
height: 60px;
display: block;
}
Obviously I'm missing something simple here