<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CUAFQHk_fCp7ImA9WxFRFk4.&quot;"><id>tag:blogger.com,1999:blog-2014235011245912144</id><updated>2010-04-30T06:21:51.744-07:00</updated><title>Web Lunatic</title><subtitle type="html">Let's make it a bit better...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://dorianlyder.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://dorianlyder.blogspot.com/" /><author><name>Dorian</name><uri>http://www.blogger.com/profile/08950340428868639403</uri><email>info@dorianlyder.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/WebLunatic" /><feedburner:info uri="weblunatic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D08EQXY-fCp7ImA9WxBXF00.&quot;"><id>tag:blogger.com,1999:blog-2014235011245912144.post-3063393597309751040</id><published>2009-07-03T13:23:00.000-07:00</published><updated>2010-01-28T11:10:00.854-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-28T11:10:00.854-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="css tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="centered elements" /><category scheme="http://www.blogger.com/atom/ns#" term="page layout" /><category scheme="http://www.blogger.com/atom/ns#" term="liquid design" /><category scheme="http://www.blogger.com/atom/ns#" term="positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="css" /><title>Creating a fully centered webpage</title><content type="html">&lt;p&gt;So, here we go again.&lt;/p&gt;

&lt;p&gt;We've all read many articles on fully centering an element of a webpage e.g. a div or an image, and most likely they were great. I've read some that use css and many that use javascript to achieve the desired look and feel of your webpage. What I want to talk about today, is centering the entire webpage.&lt;/p&gt;

&lt;p&gt;For those of you who need an example, downsize the width of your browser right now. You should see this page keeping it's center point no matter how slim the window may be, as well as no horizontal scrollbars appear when you downsize.&lt;/p&gt;

&lt;p&gt;You're probably asking "Why would I want to do this?".&lt;/p&gt;

&lt;p&gt;Essentially, there is no real reason why you should do this, however, if you're looking to add a bit extra to your website, this could prove to be an interesting take on design.&lt;/p&gt;

&lt;p&gt;Before we continue, allow me to point out the cons of this approach:&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight:bold;"&gt;1)&lt;/span&gt; This method is not friendly to users with a low screen resolution (They will never see a horizontal scrollbar).&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight:bold;"&gt;2)&lt;/span&gt; If you're looking for a &lt;a href="http://jigsaw.w3.org/css-validator/"&gt;W3C CSS Validation Tag&lt;/a&gt;, you won't get it because of one CSS3 property used in this method - &lt;span style="font-weight: bold;"&gt;overflow-x&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;So, let's get started.....&lt;/p&gt;

&lt;p&gt;Essentially the first step you need to take is styling the body of your document:&lt;/p&gt;

&lt;pre&gt;
&lt;span style="color: rgb(204, 51, 204);"&gt;body {&lt;/span&gt;
    &lt;span style="color: rgb(0, 153, 0);"&gt;font:&lt;/span&gt; Arial, Helvetica, sans-serif;
    &lt;span style="color: rgb(0, 153, 0);"&gt;font-size:&lt;/span&gt; 12px !important;
    &lt;span style="color: rgb(0, 153, 0);"&gt;color:&lt;/span&gt; #fff;
    &lt;span style="color: rgb(0, 153, 0);"&gt;margin:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;padding:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;width:&lt;/span&gt; 100%;
    &lt;span style="color: rgb(0, 153, 0);"&gt;height:&lt;/span&gt; 100%;
&lt;span style="color: rgb(204, 51, 204);"&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;
&lt;p&gt;It is very important that you set both width &amp;amp; height (well mainly height) properties to 100%. We basically do this for MSIE6.  With these properties set, IE6 now understands that it has the entire viewport to play with.&lt;/p&gt;

&lt;p&gt;Next, by convention, I normally use #container, some may use #wrapper, but, you can use whatever naming convention you'd like for your container div. Your container div is very essential in this process. Your entire document shoud be placed inside this div. It is a good practice as it allows for you to position other divs behind or in front of it with ease. e.g. if you had &lt;a href="http://plugins.jquery.com/project/jquerylightbox_bal"&gt;jQuery lightbox&lt;/a&gt; implemented on your website.&lt;/p&gt;

&lt;pre&gt;
&lt;span style="color: rgb(204, 51, 204);"&gt;#container {&lt;/span&gt;
    &lt;span style="color: rgb(0, 153, 0);"&gt;margin:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;padding:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;min-height:&lt;/span&gt; 100%;
    &lt;span style="color: rgb(0, 153, 0);"&gt;height:&lt;/span&gt; auto !important;
    &lt;span style="color: rgb(0, 153, 0);"&gt;background-color:&lt;/span&gt; #000;
    &lt;span style="color: rgb(0, 153, 0);"&gt;height:&lt;/span&gt; 100%;
    &lt;span style="color: rgb(0, 153, 0);"&gt;width:&lt;/span&gt; 100%;
    &lt;span style="color: rgb(0, 153, 0);"&gt;position:&lt;/span&gt; absolute;
    &lt;span style="color: rgb(0, 153, 0);"&gt;left:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;top:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;overflow-x:&lt;/span&gt; hidden;
&lt;span style="color: rgb(204, 51, 204);"&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;

&lt;p&gt;Now let me explain. First off, position the container div to provide future editing in regards to z-index and so on, although most likely you won't need to. The most important property is:&lt;/p&gt;

&lt;p&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;overflow-x: &lt;/span&gt;This is our code that eliminates the horizontal scrollbar. It is a CSS3 pseudo class and is not recognised yet as valid styling, however, it works on all platforms.&lt;/p&gt;

&lt;p&gt;Special thanks to &lt;span style="font-weight:bold;"&gt;Dexter Banfield&lt;/span&gt; who showed me the light with overflow. Follow on &lt;a href="http://twitter.com/thedragonpope"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We use the height properties for sticky footers and backgrounds which I'll explain in another post, however, it's worthy of mention here.&lt;/p&gt;

&lt;p&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;min-height:&lt;/span&gt; 100%;
&lt;span style="color: rgb(0, 153, 0);"&gt;height:&lt;/span&gt; auto !important;
&lt;span style="color: rgb(0, 153, 0);"&gt;height:&lt;/span&gt; 100%;&lt;/p&gt;

&lt;p&gt;Special thanks to &lt;span style="font-weight:bold;"&gt;Dustin Diaz&lt;/span&gt; and his post &lt;a href="http://www.dustindiaz.com/min-height-fast-hack/"&gt;Min-Height Fast Hack&lt;/a&gt;. Essentially, the min-height property works as it should on all modern browsers i.e. you specify a minimum height, and the element conforms to it with the ability to become taller. However, some versions of MSIE, don't support it. You can use this hack to achieve min-height in those browsers. B.T.W. This also works for min-width.&lt;/p&gt;

&lt;p&gt;So now we have our container styled. Your HTML should look like this:&lt;/p&gt;

&lt;pre&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div&lt;/span&gt; id="container"&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;gt;&lt;/span&gt;

    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;

&lt;/p&gt;If your code is correct, you should see a black page when you test in a browser.&lt;/p&gt;

&lt;/p&gt;Now let's create our extremely massive divs which allow for complete centering:&lt;/p&gt;


&lt;pre&gt;
&lt;span style="color: rgb(204, 51, 204);"&gt;.holder {&lt;/span&gt;
    &lt;span style="color: rgb(0, 153, 0);"&gt;padding:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;width:&lt;/span&gt; 1300%;
    &lt;span style="color: rgb(0, 153, 0);"&gt;margin-left:&lt;/span&gt; 0px 0px 0px -600%;
    &lt;span style="color: rgb(0, 153, 0);"&gt;display:&lt;/span&gt; block;
    &lt;span style="color: rgb(0, 153, 0);"&gt;background-color:&lt;/span&gt; #333;
&lt;span style="color: rgb(204, 51, 204);"&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;

&lt;p&gt;Ah yes.... the holder class. We'll use this to encapsulate each layer i.e. nav, header,etc. We make it a class as we need to use it for each new block we make. Firstly, we adhere to the block layout by defining it's display as block. This is the default layout method of any container. It's not necessary to specify it, however, it's a good practice.&lt;/p&gt;

&lt;p&gt;What I want you to note is the &lt;span style="color: rgb(0, 153, 0);"&gt;width&lt;/span&gt; property as well as the &lt;span style="color: rgb(0, 153, 0);"&gt;margin&lt;/span&gt; property.
This is a concept which may seem confusing at first and there may be a much better approach, but let's examine it a bit.&lt;/p&gt;

&lt;p&gt;Firstly, I've set the width to 1300%. I use that figure because it works best. You can have a larger figure, but, it won't be necessary, and a lower figure, does not give the desired effect.&lt;/p&gt;

&lt;p&gt;By using 1300%, we are specifying that this element should be 13 times the size of the viewport width.&lt;/p&gt;

&lt;/p&gt;I know, I know, you're probably asking "Why not 1200 or 1400 percent?". We'll use an odd number for one sole reason. Think about the Maths involved. We have the viewport which is 100%. Then we have this container which is 1300% with a margin-left of -600%. So what does this mean?&lt;/p&gt;

&lt;p&gt;This container will be placed -600% to the left, which gives us an excess of 700%. 100% will cover the viewport area, therfore, we have basically a 600% space to the right.&lt;/p&gt;
&lt;p&gt;This container is now perfectly centered.&lt;/p&gt;

&lt;p&gt;So if were to now add a holder div to our HTML with some random text, let's see what happens:&lt;/p&gt;

&lt;pre&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div id="container"&amp;gt;&lt;/span&gt;

        &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div&lt;/span&gt; class="holder"&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;gt;&lt;/span&gt;Blah Blah Blah&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;

&lt;p&gt;You'd most likely see the grey div at the top of your page, but no text. Why?
Essentially, the text is aligned to the left; -600% to the left of the viewport.&lt;/p&gt;

&lt;p&gt;"Oh no.... This is lame, it's not working well at all". Don't say that please. There's still hope. If you want the harder way out, you can set the text-align property to center. This way you'll see the text in the middle of the screen. Try that and see how it works. Resize your browser as well.&lt;/p&gt;

&lt;p&gt;You should see the text staying center no matter what. It doesn't stop at the left edge of the browser.&lt;/p&gt;

&lt;p&gt;But still, text-align: center? That means that all our text,images,etc. have to be re-aligned. That's way too much work.&lt;/p&gt;

&lt;p&gt;So let's add another div class:&lt;/p&gt;

&lt;pre&gt;
&lt;span style="color: rgb(204, 51, 204);"&gt;.element{&lt;/span&gt;
    &lt;span style="color: rgb(0, 153, 0);"&gt;width:&lt;/span&gt; 900px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;margin:&lt;/span&gt; 0px auto 0px auto;
    &lt;span style="color: rgb(0, 153, 0);"&gt;padding:&lt;/span&gt; 0px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;background-color:&lt;/span&gt; #999;
&lt;span style="color: rgb(204, 51, 204);"&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;

&lt;p&gt;&lt;span style="font-weight: bold;"&gt;N.B.&lt;/span&gt; margin-left &amp;amp; margin-right will work when you specify an explicit width. So if we add an element div to our code, let's see what happens:&lt;/p&gt;

&lt;pre&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div id="container"&amp;gt;&lt;/span&gt;

        &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div class="holder"&amp;gt;&lt;/span&gt;
            &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div&lt;/span&gt; class="element"&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;gt;&lt;/span&gt;Blah Blah Blah&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;

&lt;p&gt;You should now see a black document, a dark grey div running straight across the top, a lighter grey div dead center at 900px wide and "Blah Blah Blah" aligned left.&lt;/p&gt;

&lt;p&gt;Let's see it in a more practical manner. Add this css &amp;amp; html respectively to your document:&lt;/p&gt;

&lt;pre&gt;
&lt;span style="color: rgb(204, 51, 204);"&gt;.topDiv{&lt;/span&gt;
    &lt;span style="color: rgb(0, 153, 0);"&gt;height:&lt;/span&gt; 200px;
&lt;span style="color: rgb(204, 51, 204);"&gt;}&lt;/span&gt;

&lt;span style="color: rgb(204, 51, 204);"&gt;.bottomDiv{&lt;/span&gt;
    &lt;span style="color: rgb(0, 153, 0);"&gt;height:&lt;/span&gt; 400px;
    &lt;span style="color: rgb(0, 153, 0);"&gt;background-color:&lt;/span&gt; #003300;
&lt;span style="color: rgb(204, 51, 204);"&gt;}&lt;/span&gt;

&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div id="container"&amp;gt;&lt;/span&gt;

        &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div class="holder"&amp;gt;&lt;/span&gt;
            &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div&lt;/span&gt; class="element topDiv"&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;gt;&lt;/span&gt;Hello from above&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

        &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div class="holder"&amp;gt;&lt;/span&gt;
            &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;div&lt;/span&gt; class="element bottomDiv"&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;gt;&lt;/span&gt;Hello from below&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;br/&gt;

&lt;p&gt;You should now see a black document, a dark grey div running straight across the top, a lighter grey div dead center at 900px wide and 200px high with "Hello from above " aligned left as well as a dark green div below saying "Hello from below".&lt;/p&gt;

&lt;p&gt;Note: You can apply multiple styles to one element, just be sure to arrange them in the order of override priority.&lt;/p&gt;

&lt;p&gt;As you can see we can add more and more layers as we see fit. We can have our nav bar, header bar, footer bar and so on...&lt;/p&gt;

&lt;p&gt;And that's all folks.....&lt;/p&gt;
&lt;p&gt;If you have any questions, feel free to leave a comment and I hope this works for you as it does for me.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2014235011245912144-3063393597309751040?l=dorianlyder.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZUQR0ohC5sCpk9P5x38xiA4M_SA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZUQR0ohC5sCpk9P5x38xiA4M_SA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZUQR0ohC5sCpk9P5x38xiA4M_SA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZUQR0ohC5sCpk9P5x38xiA4M_SA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebLunatic/~4/VE1KzFjSaFs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dorianlyder.blogspot.com/feeds/3063393597309751040/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dorianlyder.blogspot.com/2009/07/creating-fully-centered-webpage.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2014235011245912144/posts/default/3063393597309751040?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2014235011245912144/posts/default/3063393597309751040?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebLunatic/~3/VE1KzFjSaFs/creating-fully-centered-webpage.html" title="Creating a fully centered webpage" /><author><name>Dorian</name><uri>http://www.blogger.com/profile/08950340428868639403</uri><email>info@dorianlyder.com</email><gd:extendedProperty name="OpenSocialUserId" value="18137817561772212282" /></author><thr:total>0</thr:total><feedburner:origLink>http://dorianlyder.blogspot.com/2009/07/creating-fully-centered-webpage.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcEQXs6fip7ImA9WxBXF00.&quot;"><id>tag:blogger.com,1999:blog-2014235011245912144.post-2656588305396443159</id><published>2009-07-02T21:54:00.000-07:00</published><updated>2010-01-28T11:13:20.516-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-28T11:13:20.516-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MSIE8" /><category scheme="http://www.blogger.com/atom/ns#" term="map offset fix" /><category scheme="http://www.blogger.com/atom/ns#" term="google maps click" /><category scheme="http://www.blogger.com/atom/ns#" term="coordinate offset" /><category scheme="http://www.blogger.com/atom/ns#" term="google maps ie8 problems" /><title>Google Maps &amp; MSIE8 click-coordinate offset fix</title><content type="html">&lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=false&amp;amp;key=ABQIAAAAT6de9cmUTDCsI2nJj7LbRxSi_YxRFUwz94K0rBB_n3-sBvqryBRcbFwIlzX639P9SjHGkC3EbeuHLQ" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript" language="javascript"&gt;

function addEvent(target, eventType, eventFunction)
{
 if (target.addEventListener)
 {
  target.addEventListener(eventType, eventFunction, false);
 }
 
 if (target.attachEvent)
 {
  target.attachEvent('on' + eventType, eventFunction);
 }
}

var marker;
function initMap()
{
 var map;
 
 if (GBrowserIsCompatible())
 {
  map = new GMap2(document.getElementById("map")); 
  map.setCenter(new GLatLng(10.682338015927815,-61.55539908763124), 13);
  map.setUIToDefault();
  if(marker == null || typeof(marker) == 'undefined')
  {
   marker = new GMarker(new GLatLng(10.682338015927815,-61.55539908763124));
   map.addOverlay(marker);
  }
  else
  {
   marker.setLatLng(new GLatLng(10.682338015927815,-61.55539908763124));
  }
  
  
  GEvent.addListener(map,'click',function(overlay,latlng)
  {
   if(!latlng)
   {
    return;
   }
   if(marker == null || typeof(marker) == 'undefined')
   {
    marker = new GMarker(latlng);
    map.addOverlay(marker);    
   }    
   else
      {
    marker.setLatLng(latlng);
   }
  });  
 } 
 else
 {
         map = document.getElementById("map");   
         map.style.height = 'auto';
         map.innerHTML = '&lt;h4&gt;Sorry! Google Maps are currently unavailable&lt;/h4&gt;';
   }
}

addEvent(window,'load',function()
{
 initMap();
});
&lt;/script&gt;
&lt;div style="margin: 20px 0px; width: 100%; height: 300px; float: left; clear: none;" id="map"&gt;&lt;/div&gt;

&lt;p&gt;As you probably know, the &lt;a href="http://code.google.com/apis/maps/" target="blank"&gt;google maps&lt;/a&gt; api is an intuitive way to display addresses, locations, and information targeted at your users. The api is simple to use, well documented and best of all free for non-enterprise usage.&lt;/p&gt;

&lt;p&gt;As with every system, there must be a hiccup somewhere along the line. Take for instance the map that should be visible above. There is a default marker set in the middle and it displays the general location of my hometown. If you click on it, the marker will change position to wherever you clicked.&lt;/p&gt;

&lt;p&gt;If you are on any browser besides Microsoft Internet Explorer 8, it should work flawlessly. The problem I'm speaking about lies within MSIE8. If you click anywhere on the map, the marker will change position, however, it's placed with about a 1 &amp;frac12; inch offset (providing blogger isn't already on the MS compatibility mode listing). This is not the fault of the api....&lt;/p&gt;

&lt;p&gt;There is hope though. Microsoft has been generous enough to issue a meta tag that can solve this problem:&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: bold;"&gt;&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This tag basically forces MSIE8 to emulate it's predecessor MSIE7... And here I was thinking that the browser was an upgrade.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2014235011245912144-2656588305396443159?l=dorianlyder.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bi7OnwCDWodlT5cTx18UOXmMDSs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bi7OnwCDWodlT5cTx18UOXmMDSs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bi7OnwCDWodlT5cTx18UOXmMDSs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bi7OnwCDWodlT5cTx18UOXmMDSs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebLunatic/~4/KOZ5B0XPADk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dorianlyder.blogspot.com/feeds/2656588305396443159/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dorianlyder.blogspot.com/2009/07/google-maps-msie8-click-coordinate.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2014235011245912144/posts/default/2656588305396443159?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2014235011245912144/posts/default/2656588305396443159?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebLunatic/~3/KOZ5B0XPADk/google-maps-msie8-click-coordinate.html" title="Google Maps &amp; MSIE8 click-coordinate offset fix" /><author><name>Dorian</name><uri>http://www.blogger.com/profile/08950340428868639403</uri><email>info@dorianlyder.com</email><gd:extendedProperty name="OpenSocialUserId" value="18137817561772212282" /></author><thr:total>2</thr:total><feedburner:origLink>http://dorianlyder.blogspot.com/2009/07/google-maps-msie8-click-coordinate.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08NSX84eSp7ImA9WxBXF00.&quot;"><id>tag:blogger.com,1999:blog-2014235011245912144.post-5154119900471602604</id><published>2009-07-02T12:10:00.000-07:00</published><updated>2010-01-28T11:11:38.131-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-28T11:11:38.131-08:00</app:edited><title>New to blogging</title><content type="html">&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;I recently decided to jump on the blogging bandwagon for two reasons:&lt;/p&gt;

&lt;p&gt;1) Boredom&lt;/p&gt;
&lt;p&gt;2) Too many thoughts welled up in my head&lt;/p&gt;

&lt;p&gt;Basically I intend to post the solutions to any problem I may have encountered on the web and solved. Who knows maybe someone will find it useful....&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2014235011245912144-5154119900471602604?l=dorianlyder.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wM6f2PjqPNDWbCj54hGquFFc8sc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wM6f2PjqPNDWbCj54hGquFFc8sc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wM6f2PjqPNDWbCj54hGquFFc8sc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wM6f2PjqPNDWbCj54hGquFFc8sc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WebLunatic/~4/M0wE1R6ErJg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dorianlyder.blogspot.com/feeds/5154119900471602604/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dorianlyder.blogspot.com/2009/07/new-to-blogging.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2014235011245912144/posts/default/5154119900471602604?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2014235011245912144/posts/default/5154119900471602604?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebLunatic/~3/M0wE1R6ErJg/new-to-blogging.html" title="New to blogging" /><author><name>Dorian</name><uri>http://www.blogger.com/profile/08950340428868639403</uri><email>info@dorianlyder.com</email><gd:extendedProperty name="OpenSocialUserId" value="18137817561772212282" /></author><thr:total>0</thr:total><feedburner:origLink>http://dorianlyder.blogspot.com/2009/07/new-to-blogging.html</feedburner:origLink></entry></feed>

