0

I added a google map on my page here: http://www.comehike.com/outdoors/trees/trees.php?tree=43

But for some reason, I can't get 2 things right: 1) The page got shifted to the left 2) And I can't get the map to be the width of the page, and a set length in pixels - is that possible? Right now I just have style="width:750px; height:300px" for the map_canvas div.

Thanks, Alex

2
  • Can you explain what you want it to look like in a little more detail? What do you mean by "the page got shifted to the left". For the map width, can't you just set the style to be width: 100%; height: 300px;? Commented Feb 17, 2011 at 4:10
  • Can you supply the HTML and CSS or put your example up on jsfiddle. It's quite hard to troll through the source code to find the bits and pieces. Commented Feb 17, 2011 at 4:15

1 Answer 1

1

Regarding your page "shifting to the left," I noticed the following style at the top of the page:

 body { height: 100%; width: 70%; margin: 0px; padding: 0px } 

Are you certain you don't just want to remove the height and width specifiers? This will cram your page into 70% of the browser window width. I don't think this is a Google Maps issue. Not sure if that's the behavior you were describing.

As for the Google Maps width, remove "width: 750px;" from the inline style on div#map_canvas. Block level elements such as divs automatically span the full width of their container without any further intervention from CSS styles. You need only give it the height, otherwise a browser would render the div with height: 0px.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.