<?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"
	>
<channel>
	<title>Comments on: CSS Tip: Positioning Part 2 - Static vs Fixed</title>
	<atom:link href="http://www.screenflicker.com/blog/coding/css-tip-positioning-part-2-static-vs-fixed/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.screenflicker.com/blog/coding/css-tip-positioning-part-2-static-vs-fixed/</link>
	<description>Web design and development in Calgary</description>
	<pubDate>Wed, 08 Sep 2010 14:49:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: CSS Tip: Positioning Part 1 Screenflicker Developments</title>
		<link>http://www.screenflicker.com/blog/coding/css-tip-positioning-part-2-static-vs-fixed/#comment-518</link>
		<dc:creator>CSS Tip: Positioning Part 1 Screenflicker Developments</dc:creator>
		<pubDate>Mon, 15 May 2006 04:03:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.screenflicker.com/blog/?p=23#comment-518</guid>
		<description>[...] In the next installment of the CSS Tip: Positioning I&#8217;ll cover the static and fixed positioning properties. [...]</description>
		<content:encoded><![CDATA[<p>[...] In the next installment of the CSS Tip: Positioning I&#8217;ll cover the static and fixed positioning properties. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.screenflicker.com/blog/coding/css-tip-positioning-part-2-static-vs-fixed/#comment-21</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 05 Sep 2005 16:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.screenflicker.com/blog/?p=23#comment-21</guid>
		<description>Yes, static keeps elements in the normal flow. If you look at the &lt;a href="http://www.screenflicker.com/tests/css/staticfixed1.html" title="First example test page" rel="nofollow"&gt;test page from the first example&lt;/a&gt; you can see, in a side by side comparison, that the top edge of the blue boxes both line up. So even though the green box on the left is positioned lower, the static property on the blue box ensures that it is placed as if the green box was positioned normally.

As far as the fixed background goes, it can be done one of several ways, depending on the effect you'd like to achieve. Since I can't read your mind, at least not yet anyway but I'm working on it, I would suggest looking more into the &lt;code&gt;background&lt;/code&gt; property â€” more specifically &lt;code&gt;background-attachment&lt;/code&gt;.

As an example though, if you'd like the background to be for the entire page you can just define it in the html or body tags like so:

&lt;code&gt;body {
&#160;&#160;&#160;&#160;background: url(path/to/your/image.jpg) no-repeat fixed top left;
}&lt;/code&gt;

Another option would be to put the background in the containing &lt;code&gt;div&lt;/code&gt; if you're using a fixed width layout.</description>
		<content:encoded><![CDATA[<p>Yes, static keeps elements in the normal flow. If you look at the <a href="http://www.screenflicker.com/tests/css/staticfixed1.html" title="First example test page" rel="nofollow">test page from the first example</a> you can see, in a side by side comparison, that the top edge of the blue boxes both line up. So even though the green box on the left is positioned lower, the static property on the blue box ensures that it is placed as if the green box was positioned normally.</p>
<p>As far as the fixed background goes, it can be done one of several ways, depending on the effect you&#8217;d like to achieve. Since I can&#8217;t read your mind, at least not yet anyway but I&#8217;m working on it, I would suggest looking more into the <code>background</code> property â€” more specifically <code>background-attachment</code>.</p>
<p>As an example though, if you&#8217;d like the background to be for the entire page you can just define it in the html or body tags like so:</p>
<p><code>body {<br />
&nbsp;&nbsp;&nbsp;&nbsp;background: url(path/to/your/image.jpg) no-repeat fixed top left;<br />
}</code></p>
<p>Another option would be to put the background in the containing <code>div</code> if you&#8217;re using a fixed width layout.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henrik</title>
		<link>http://www.screenflicker.com/blog/coding/css-tip-positioning-part-2-static-vs-fixed/#comment-20</link>
		<dc:creator>Henrik</dc:creator>
		<pubDate>Mon, 05 Sep 2005 16:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.screenflicker.com/blog/?p=23#comment-20</guid>
		<description>Hi!

Nice :) Good for refreshing knowledge.

I was wondering. About static - that's just normal flow, isn't it?

About fixed and z-index - if you have a couple of static (flowing) blocks/boxes and you decide to put a fixed background in, using a fixed block - how do you write as to make the fixed element come to the lowest possible z index of the viewport? Since I've tried to put z-index:1; to it while giving all other
* { z-index: 100; } or simply going through each block manually setting z-index:
#wrapper, #content, #main, #... {
z-index:100;
}

Any ideas?</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Nice :) Good for refreshing knowledge.</p>
<p>I was wondering. About static - that&#8217;s just normal flow, isn&#8217;t it?</p>
<p>About fixed and z-index - if you have a couple of static (flowing) blocks/boxes and you decide to put a fixed background in, using a fixed block - how do you write as to make the fixed element come to the lowest possible z index of the viewport? Since I&#8217;ve tried to put z-index:1; to it while giving all other<br />
* { z-index: 100; } or simply going through each block manually setting z-index:<br />
#wrapper, #content, #main, #&#8230; {<br />
z-index:100;<br />
}</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
