<?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>Rodes Web Design &#38; Development &#187; javascript</title>
	<atom:link href="http://www.rodes.net/wp/wordpress/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rodes.net/wp/wordpress</link>
	<description>Web Design, Hosting, SEO and Statistical Analysis</description>
	<lastBuildDate>Fri, 27 Jan 2012 02:36:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
<link>http://www.rodes.net/wp/wordpress</link>
<url>http://www.rodes.net/wp/wordpress/wp-content/mbp-favicon/rodesfav.ico</url>
<title>Rodes Web Design &amp; Development</title>
</image>
		<item>
		<title>Fixed footer without javascript</title>
		<link>http://www.rodes.net/wp/wordpress/2008/12/26/fixed-footer-without-javascript/</link>
		<comments>http://www.rodes.net/wp/wordpress/2008/12/26/fixed-footer-without-javascript/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 05:05:13 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rodes]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://www.rodes.net/wp/wordpress/2008/10/02/fixed-footer-without-javascript/</guid>
		<description><![CDATA[A recent project required that I create a page footer which would stick to the bottom of the browser window if the content didn’t fill the window, but behave normally (i.e. be pushed down by the content) when the content was tall enough.
This footer behaviour is not a new idea; I’ve seen it on a few sites [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ionebusiness.com.au/Graphics/web-design.jpg" border="0" alt="Web Design Abstract Logo" hspace="1" vspace="1" width="200" height="150" align="left" />A recent project required that I create a page footer which would stick to the bottom of the browser window if the content didn’t fill the window, but behave normally (i.e. be pushed down by the content) when the content was tall enough.</p>
<p>This footer behaviour is not a new idea; I’ve seen it on a few sites over the years, the most well known probably being <a href="http://si7.shauninman.com/" target="_blank">version 7 of Shaun Inman’s site</a>. Take a look at the ‘Work’ page with JavaScript enabled, then disabled to see the effect in action.<span id="more-29"></span></p>
<p>I suspect that this behaviour, which can look great in the right situation, has not been widely adopted because existing solutions have always relied on JavaScript for what should be a simple presentation issue.</p>
<p>The technique described in this article is purely a CSS solution and works in all modern browsers, tested down to IE5.5.</p>
<p>Firstly, <a href="http://rodes.net/fixedfooter.html">here’s a demonstration</a>.</p>
<h3>The HTML</h3>
<p align="left"><code>&lt;div id="container"&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;div id="footer"&gt;&lt;/div&gt; &lt;/div&gt; </code></p>
<h3>The CSS</h3>
<p align="left"><code>*, body {margin: 0; padding: 0;} #container {display: block; position: absolute;</code><br />
<code>min-height: 100%;} #content {display: block; margin-bottom: 3em;} #footer {position:</code></p>
<pre><code> absolute; display: block; bottom: 0; height: 3em } </code></pre>
</p>
<p align="left">IE6 Stylesheet<br />
<code>body, #container {height: 100%;}</code>&lt; this should be referenced using a conditional comment:<br />
<code>&lt;!--[if lt IE 7]&gt; &lt;link href="css/ie6.css" mce_href="css/ie6.css" rel="stylesheet"<br />
</code><code>type="text/css" media="screen" &gt; &lt;![endif]--&gt;</code></p>
<h3>How it works</h3>
<p>As you can see, the mark-up and styling are pretty simple. Here’s a quick run-through of what’s going on&#8230;</p>
<ul>
<li><strong>#container</strong> is set to be at least as tall as the browser window using min-height and although IE6 doesn’t understand this, it treats height in exactly the same way. <strong>#container</strong> must be positioned absolutely, or this will not work.</li>
<li><strong>#footer</strong> is positioned absolutely at the bottom of <strong>#container</strong></li>
<li><strong>#content</strong> is given a bottom margin equal to the height of <strong>#footer</strong> to prevent the two ever overlapping.</li>
</ul>
<h3>Known Issues</h3>
<p>The simplicity of this technique makes it fairly reliable and the only real issues to consider are for IE6 and below. For these browsers you’ll need to specify any additional containers as also having a height of 100%.</p>
<p>For example, if your mark-up was:<br />
<code>&lt;div id="extraContainer"&gt; &lt;div id="container"&gt; &lt;div id="content"&gt;&lt;/div&gt;</code><br />
<code>&lt;div id="footer"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</code><br />
In your IE specific CSS you’d need to specify:<br />
<code>body, #extraContainer, #container {height: 100%;}</code></p>
<h3>Conclusion</h3>
<p>This is a nice and easy solution to those unsightly gaps below your footers and while it won’t be appropriate for every site, it might come in handy from time to time.</p>
<p><span style="font-size: xx-small;"><em>technique developed by Ed Merritt at HeadScape.</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rodes.net/wp/wordpress/2008/12/26/fixed-footer-without-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

