<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'Centering an element in page with absolute position'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Fri, 05 Sep 2008 09:11:38 GMT</pubDate>
<item>
<title>SmpleJohn said on 1/28/08</title>
<link>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</link>
<description><![CDATA[ <p>Out of curiosity, why would you need a separate ie &amp; moz tag?  "margin:auto;" should work in both.</p>
 ]]></description>
<pubDate>Mon, 28 Jan 2008 10:54:30 GMT</pubDate>
<guid>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</guid>
</item>
<item>
<title>SmpleJohn said on 1/28/08</title>
<link>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</link>
<description><![CDATA[ <p>Out of curiosity, why would you need a separate ie &amp; moz tag?  "margin:auto;" should work in both.</p>
 ]]></description>
<pubDate>Mon, 28 Jan 2008 10:34:55 GMT</pubDate>
<guid>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</guid>
</item>
<item>
<title>adix said on 1/28/08</title>
<link>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</link>
<description><![CDATA[ <p><style type="text/css">
  .ie-center { 
    text-align:center; 
  }</p>

<p>.moz-center {
    margin:auto;
    text-align:center; 
    width:250px;
  } </p>

<p>.center-box { 
    border:1px solid #efefef;
    background:#efefef;
    width:100%;
    height:125px;
  }
</style></p>

<p><div class="ie-center">
  <div class="">
    <div class="center-box"></div>
  </div>
</div></p>

<p>center-box will be centered, will have 250px in width.</p>
 ]]></description>
<pubDate>Mon, 28 Jan 2008 02:22:24 GMT</pubDate>
<guid>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</guid>
</item>
<item>
<title>adix said on 1/28/08</title>
<link>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</link>
<description><![CDATA[ <p><style type="text/css">
  .ie-center { 
    text-align:center; 
  }</p>

<p>.moz-center {
    margin:auto;
    text-align:center; 
    width:250px;
  } </p>

<p>.center-box { 
    border:1px solid #efefef;
    background:#efefef;
    width:100%;
    height:125px;
  }
</style></p>

<p><div class="ie-center">
  <div class="">
    <div class="center-box"></div>
  </div>
</div></p>

<p>center-box will be centered, will have 250px in width.</p>
 ]]></description>
<pubDate>Mon, 28 Jan 2008 02:21:47 GMT</pubDate>
<guid>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</guid>
</item>
<item>
<title>adix said on 1/28/08</title>
<link>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</link>
<description><![CDATA[ <p>Your code is correct, but you are wrong.
Using percentages would result in elements that are larger than the ones the user actually needs.</p>

<p>Try this:

  .ie-center {
    text-align:center;
  }
  .moz-center {
    margin:auto;
    text-align:center;
    width:250px;
  }
  .center-box {
    border:1px solid #efefef;
    background:#efefef;
  }
</p>


  
    
  


<p>center-box will be centered, will have 250px in width.</p>
 ]]></description>
<pubDate>Mon, 28 Jan 2008 02:14:45 GMT</pubDate>
<guid>http://snipplr.com/view/4803/centering-an-element-in-page-with-absolute-position/</guid>
</item>
</channel>
</rss>