Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6218721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:39:34+00:00 2026-05-24T07:39:34+00:00

Trying to place a header bar at top of a full page Google Map

  • 0

Trying to place a header bar at top of a full page Google Map but for some reason it keeps pushing the map below the browser view and cuts off.

If I place the top header (#top) above the map, then position .mapCont to start at top:35px, where #top ends, it pushes the map below the bottom of browser and creates a scroll. Why doesn’t it just fit to 100% height regardless of the fixed position layout? It appears to be pushing it 35px below the extents of the browser window.

Cant seem to sort this one out. Thoughts?

Code:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0; padding: 0 }
  #map_canvas { width:100%; height:100%; background: #111 url(../images/loading.gif) no-repeat 50% 50%; z-index: 1; }

.mapCont { 
     display: block;
     height:100%; 
     width:100%; 
     position:fixed;
     top:35px;
     left:0;
     background-color:#111;
     z-index: 0;
}

#top{ 
    height:35px;
    width:100%;
    background: url('../images/finals/wood_top.png') repeat-x;
    display: block;
    position:fixed;
    top:0;
    left:0;
    z-index: 100;
}

.headerLine {
    height:14px;
    width:100%;
    background: url('../images/finals/headerLine.png') repeat-x;
    display: block;
    position:fixed;
    top:31px;
    left:0;
    z-index: 99;
}

</style>

<script type="text/javascript"
    src="http://maps.googleapis.com/maps/api/js?sensor=false">
</script>

<script type="text/javascript">
  function initialize() {
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);
  }

</script>
</head>
<body onload="initialize()">

<div id="top">  

        <div class="mapCont">
          <div id="map_canvas"></div>
        </div>

</div>
<div class="headerLine"></div>

</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:39:35+00:00Added an answer on May 24, 2026 at 7:39 am

    Your calculating 100% + 35px in .mapCont

    Have you tried adding overflow:hidden; to the body ?

    This works for me: http://jsfiddle.net/SV8VB/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to place some simple effects on an image using HBox using
I'm trying to place a branding bar (320x22) above the UINavigationBar in a UINavigationController.
I'm trying to place a DropDownList inside a WebGrid but I can't figure out
I'm trying to lay out a web page like this: |-----------------------| | header (fixed)
I'm trying to place normal size text on the same line as a header
I need some help! :) I am trying to put a header png image
I am trying to place my header <h1> over a div class named light
My header got an image, and im trying to place a text block over
I am trying to request JSON from Google Places API, but I am still
I am trying to place one on top of another at my website finegra.in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.