<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Horizontally and vertically center a box in the browser window</title>
	<atom:link href="http://www.swedishfika.com/2008/02/24/horizontally-and-vertically-center-a-box-in-the-browser-window/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.swedishfika.com/2008/02/24/horizontally-and-vertically-center-a-box-in-the-browser-window/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 02 Dec 2011 15:11:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Simon</title>
		<link>http://www.swedishfika.com/2008/02/24/horizontally-and-vertically-center-a-box-in-the-browser-window/comment-page-1/#comment-13221</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Sun, 01 May 2011 10:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://swedishfika.com/2008/02/24/horizontally-and-vertically-centre-a-website-in-the-browser-window/#comment-13221</guid>
		<description>@Antoxa I think one approach is to use a javascript to dynamically set margin-top. This is quite easy if you use jQuery or Prototype. With Prototype you should be able to do something like this: 

Event.observe(window, &#039;load&#039;, function(e){
  $$(&#039;.box&#039;).each(function(node){
    node.setStyle({
       marginTop: &#039;-&#039; + (node.getHeight()/2) + &#039;px&#039;
   });
  });
});

And you should probably round the node.getHeight()/2 calculation above so you don&#039;t end up with decimals. </description>
		<content:encoded><![CDATA[<p>@Antoxa I think one approach is to use a javascript to dynamically set margin-top. This is quite easy if you use jQuery or Prototype. With Prototype you should be able to do something like this: </p>
<p>Event.observe(window, &#8216;load&#8217;, function(e){<br />
  $$(&#8216;.box&#8217;).each(function(node){<br />
    node.setStyle({<br />
       marginTop: &#8216;-&#8217; + (node.getHeight()/2) + &#8216;px&#8217;<br />
   });<br />
  });<br />
});</p>
<p>And you should probably round the node.getHeight()/2 calculation above so you don&#8217;t end up with decimals.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antoxa</title>
		<link>http://www.swedishfika.com/2008/02/24/horizontally-and-vertically-center-a-box-in-the-browser-window/comment-page-1/#comment-13196</link>
		<dc:creator>Antoxa</dc:creator>
		<pubDate>Fri, 29 Apr 2011 14:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://swedishfika.com/2008/02/24/horizontally-and-vertically-centre-a-website-in-the-browser-window/#comment-13196</guid>
		<description>If box without fixed height?</description>
		<content:encoded><![CDATA[<p>If box without fixed height?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atul</title>
		<link>http://www.swedishfika.com/2008/02/24/horizontally-and-vertically-center-a-box-in-the-browser-window/comment-page-1/#comment-2788</link>
		<dc:creator>Atul</dc:creator>
		<pubDate>Fri, 27 Mar 2009 09:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://swedishfika.com/2008/02/24/horizontally-and-vertically-centre-a-website-in-the-browser-window/#comment-2788</guid>
		<description>Thanks a lot man... for your nice and simple explanation....</description>
		<content:encoded><![CDATA[<p>Thanks a lot man&#8230; for your nice and simple explanation&#8230;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

