<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean O Sears &#187; css</title>
	<atom:link href="http://www.seanosears.com/blog/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.seanosears.com/blog</link>
	<description>Just another pressurer blogger ...</description>
	<lastBuildDate>Tue, 25 Aug 2009 17:49:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Auto-width Margins for centering</title>
		<link>http://www.seanosears.com/blog/2009/auto-width-margins-for-centering/</link>
		<comments>http://www.seanosears.com/blog/2009/auto-width-margins-for-centering/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 16:24:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://www.seanosears.com/blog/?p=14</guid>
		<description><![CDATA[Ok. I've always used div align="center" to horizontally center a container within another container. I know it's on the "depreciated" list, but all the browsers still respect it - and it's just always how I've done things. However, I was working in a friends CMS (un-named), and realized that it was changing my code to  div style="text-align:center" which I KNOW is not the correct way to do things (even though I have used it in the past with some success centering block-level elements).]]></description>
			<content:encoded><![CDATA[<p>Ok. For years I&#8217;ve used <em>div align=&#8221;center&#8221;</em> to horizontally center one container within another container. I know it&#8217;s on the &#8220;depreciated&#8221; list, but all the browsers still respect it &#8211; and it&#8217;s just always how I&#8217;ve done things. However, I was working in a friends CMS (un-named), and realized that it was changing my code to  <em>div style=&#8221;text-align:center&#8221;</em> which I KNOW is not the correct way to do things (even though I have used it in the past with some success centering block-level elements). Like you know, there are usually 100 different ways to skin any cat (sorry cats) and depending on what day of the week it is, I will use different methods. However, I needed to find something to add to my &#8220;only way I will center from now on&#8221; list.</p>
<p>So after digging around and testing in as many browsers (mac and pc) that I have around, here is the &#8220;proper&#8221; way to do it today (thanks to bluerobot.com).</p>
<blockquote><p>Let&#8217;s say you have a <em>div id=&#8221;container&#8221; </em>where the width is 100%, and you want <em>div id=&#8221;content&#8221;</em> that&#8217;s 500px wide horizontally centered in it?</p>
<p>Set the margin style for the #content div to be: <strong>margin:0px auto</strong>.</p></blockquote>
<p>Now even though IE5/Win does not respect this (almost wanting to say &#8220;WHO CARES&#8221;),<br />
there is a very simple work around. See: <a href="http://www.bluerobot.com/web/css/center1.html" target="_blank">http://www.bluerobot.com/web/css/center1.html</a></p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seanosears.com/blog/2009/auto-width-margins-for-centering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

