<?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>AlexCline.net &#187; CSS Tips and Tricks</title>
	<atom:link href="http://alexcline.net/category/internet/css-tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexcline.net</link>
	<description>The musings of a geek, cyclist, cinephile, yogi, diver, philosopher and gamer.</description>
	<lastBuildDate>Wed, 09 May 2012 13:55:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Correcting the 2 pixel difference in the width of a div in IE and Firefox.</title>
		<link>http://alexcline.net/2006/06/28/correcting-the-2-pixel-difference-in-the-width-of-a-div-in-ie-and-firefox/</link>
		<comments>http://alexcline.net/2006/06/28/correcting-the-2-pixel-difference-in-the-width-of-a-div-in-ie-and-firefox/#comments</comments>
		<pubDate>Wed, 28 Jun 2006 14:10:53 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips and Tricks]]></category>

		<guid isPermaLink="false">http://alex.elementfx.com/archives/2006/06/28/correcting-the-2-pixel-difference-in-the-width-of-a-div-in-ie-and-firefox/</guid>
		<description><![CDATA[This is one I struggled with for a long time. The menu at the top of my site was always giving me trouble. It would always be two pixels off when I looked at it in firefox vs. IE. This is because IE screws up the box-model. I won&#8217;t go into what exactly it screws [...]]]></description>
			<content:encoded><![CDATA[<p>This is one I struggled with for a long time.  The menu at the top of my site was always giving me trouble.  It would always be two pixels off when I looked at it in firefox vs. IE.  This is because IE screws up the box-model.  I won&#8217;t go into what exactly it screws up, but I&#8217;m telling you it does.</p>
<p>There is a simple fix to the problem though.  It requires the use of a wrapper div.  By creating a wrapper div, the two pixel difference is correctly compensated in both IE and other CSS2 compliant browsers.  Here is the code:</p>
<pre class="brush: css; title: Wrapper language=CSS; notranslate">
#wrapper {
  border-style : none;
  width : 750px;
}

#mydiv {
  width : 100%;
}
</pre>
<p>Then the HTML is pretty straight forward too:</p>
<pre class="brush: xml; title: HTML; notranslate">
&lt;div id=&quot;wrapper&quot;&gt;
  &lt;div id=&quot;mydiv&quot;&gt;
    &lt;!-- Put some content here! --&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://alexcline.net/2006/06/28/correcting-the-2-pixel-difference-in-the-width-of-a-div-in-ie-and-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>100% height divs</title>
		<link>http://alexcline.net/2006/06/28/100-height-divs/</link>
		<comments>http://alexcline.net/2006/06/28/100-height-divs/#comments</comments>
		<pubDate>Wed, 28 Jun 2006 13:50:04 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips and Tricks]]></category>

		<guid isPermaLink="false">http://alex.elementfx.com/archives/2006/06/28/100-height-divs/</guid>
		<description><![CDATA[This is a problem I ran into recently while working on a new website. How do you make a div extend the full length of the browser window? This used to be the domain of tables (yuck!), but CSS comes to save the day. Here&#8217;s the code: I did run into a little snag. When [...]]]></description>
			<content:encoded><![CDATA[<p>This is a problem I ran into recently while working on a new website.  How do you make a div extend the full length of the browser window?  This used to be the domain of tables (yuck!), but CSS comes to save the day.  Here&#8217;s the code:</p>
<pre class="brush: css; title: CSS; notranslate">
html, body {
  /* We'll tell the browser to use the whole window to display our
      site, not just the space the content takes up. */
  height : 100%;
}

#wrapper {
  /* Now, we tell the div to be the full length of the window. */
  height : 100%;
}
</pre>
<p>I did run into a little snag.  When the div is 100% of the window, setting a border(i.e. <code>border : 1px solid #666;</code>), bumps the div to be just a little too big, creating a vertical scroll bar.  To fix this, only define the left and right borders(i.e. <code>border-left : 1px solid #666; border-right : 1px solid #666;</code>) This way, the top and bottom don&#8217;t have borders.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexcline.net/2006/06/28/100-height-divs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centering content using CSS</title>
		<link>http://alexcline.net/2006/06/28/centering-content-using-css/</link>
		<comments>http://alexcline.net/2006/06/28/centering-content-using-css/#comments</comments>
		<pubDate>Wed, 28 Jun 2006 13:43:36 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CSS Tips and Tricks]]></category>

		<guid isPermaLink="false">http://alex.elementfx.com/archives/2006/06/28/centering-content-using-css/</guid>
		<description><![CDATA[This is an often asked question: How do I center stuff on my website without using tables? The answer is amazingly simple. It also validates as correct CSS, and best part of all&#8230; it doesn&#8217;t use tables! Here is the CSS: Here is the HTML:]]></description>
			<content:encoded><![CDATA[<p>This is an often asked question:</p>
<p>How do I center stuff on my website without using tables?</p>
<p>The answer is amazingly simple.  It also validates as correct CSS, and best part of all&#8230; it doesn&#8217;t use tables!<br />
Here is the CSS:</p>
<pre class="brush: css; title: CSS; notranslate">
body {
  /* We'll make sure IE centers the stuff properly. */
  text-align : center;
}

#wrapper {
  /* We'll center the content for all other GOOD browsers.
      IE doesn't center properly with this. */
  margin : 0 auto;
  width : 50%;
}
</pre>
<p>Here is the HTML:</p>
<pre class="brush: xml; title: HTML; notranslate">
&lt;body&gt;
  &lt;div id=&quot;wrapper&quot;&gt;
    &lt;!-- Put all your centered content here! --&gt;
  &lt;/div&gt;
&lt;/body&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://alexcline.net/2006/06/28/centering-content-using-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

