<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Search-This</title>
	
	<link>http://www.search-this.com</link>
	<description>Internet Marketing, Website Promotion and Blogging Advice</description>
	<pubDate>Mon, 21 Jul 2008 13:48:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/search-this" type="application/rss+xml" /><feedburner:emailServiceId>655437</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>2008 - What Apps Are You Using Survey?</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/341552829/</link>
		<comments>http://www.search-this.com/2008/07/21/2008-what-apps-are-you-using-survey/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 13:48:59 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Website Tools]]></category>

		<category><![CDATA[applications]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=704</guid>
		<description><![CDATA[It&#8217;s time for the annual survey where we ask what apps are you using? It&#8217;s real simple, tell us what tools, apps, languages and add-ons you are currently using to get your job done?
Here are mine:

Operating System - XP
Graphics Program - Adobe Fireworks
Programming IDE - Visual Studio 2008
Languages - ASP.NET, C#, JavaScript, CSS
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for the annual survey where we ask what apps are you using? It&#8217;s real simple, tell us what tools, apps, languages and add-ons you are currently using to get your job done?</p>
<p>Here are mine:</p>
<ul>
<li><strong>Operating System</strong> - XP</li>
<li><strong>Graphics Program</strong> - Adobe Fireworks</li>
<li><strong>Programming IDE</strong> - Visual Studio 2008</li>
<li><strong>Languages </strong>- ASP.NET, C#, JavaScript, CSS</li>
<li<strong>Source Control</strong> - Subversion</li>
<li><strong>FTP </strong>- SmartFTP and FileZilla</li>
<li><strong>Browser </strong>- Firefox and IE7</li>
<li><strong>Mail Client</strong> - Gmail</li>
<li><strong>Anti-Virus</strong> - AVG Antivirus</li>
<li><strong>Firewall </strong>- ZoneAlarm</li>
<li><strong>Others </strong>- Firebug, Trillian</li>
</ul>
<p>What are yours?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=VqtWMJ"><img src="http://feeds.feedburner.com/~f/search-this?i=VqtWMJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=QhgIoj"><img src="http://feeds.feedburner.com/~f/search-this?i=QhgIoj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=XXEZeJ"><img src="http://feeds.feedburner.com/~f/search-this?i=XXEZeJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=n9IB6J"><img src="http://feeds.feedburner.com/~f/search-this?i=n9IB6J" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=yTUtCj"><img src="http://feeds.feedburner.com/~f/search-this?i=yTUtCj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=pHnRKj"><img src="http://feeds.feedburner.com/~f/search-this?i=pHnRKj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=YigWXJ"><img src="http://feeds.feedburner.com/~f/search-this?i=YigWXJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=y4wfaJ"><img src="http://feeds.feedburner.com/~f/search-this?i=y4wfaJ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/07/21/2008-what-apps-are-you-using-survey/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/07/21/2008-what-apps-are-you-using-survey/</feedburner:origLink></item>
		<item>
		<title>Links for the Weekend, 7-19-2008</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/339892556/</link>
		<comments>http://www.search-this.com/2008/07/19/links-for-the-weekend-7-19-2008/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 14:16:08 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Links for the Weekend]]></category>

		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=703</guid>
		<description><![CDATA[
The Continuum Trailer - That&#8217;s some serious coding there&#8230;
Useful Tips to Enrich Your HTML Forms - Some good simple tips&#8230;
51+ Best of jQuery Tutorials and Examples - jQuery love&#8230; 
The 10 Most Ridiculous Weapons in Batman&#8217;s Arsenal - Good list&#8230;
Opera Web Standards Curriculum - Opera&#8217;s new Web Standards Curriculum, released in association with the Yahoo! [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://brajeshwar.com/2008/the-continuum-an-awesome-massive-flash-game/">The Continuum Trailer</a> - That&#8217;s some serious coding there&#8230;</li>
<li><a href="http://woork.blogspot.com/2008/07/useful-tips-to-enrich-your-html-forms.html">Useful Tips to Enrich Your HTML Forms</a> - Some good simple tips&#8230;</li>
<li><a href="http://www.noupe.com/tutorial/51-best-of-jquery-tutorials-and-examples.html">51+ Best of jQuery Tutorials and Examples</a> - jQuery love&#8230; </li>
<li><a href="http://www.toplessrobot.com/2008/07/the_10_most_ridiculous_weapons_in_batmans_arsenal.php">The 10 Most Ridiculous Weapons in Batman&#8217;s Arsenal</a> - Good list&#8230;</li>
<li><a href="http://www.opera.com/wsc/">Opera Web Standards Curriculum</a> - Opera&#8217;s new Web Standards Curriculum, released in association with the Yahoo! Developer Network, is a complete course to teach you standards-based web development, including HTML, CSS, design principles and background theory, and JavaScript basics.</li>
<li><a href="http://www.youtube.com/watch?v=NdHb_6Hs738">How to Steam Milk</a> - This is for the people at Starbucks&#8230;</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=rXGUYJ"><img src="http://feeds.feedburner.com/~f/search-this?i=rXGUYJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=nF4ZQj"><img src="http://feeds.feedburner.com/~f/search-this?i=nF4ZQj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=mOt7wJ"><img src="http://feeds.feedburner.com/~f/search-this?i=mOt7wJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=7eXH1J"><img src="http://feeds.feedburner.com/~f/search-this?i=7eXH1J" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=U9PGij"><img src="http://feeds.feedburner.com/~f/search-this?i=U9PGij" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=LVTkyj"><img src="http://feeds.feedburner.com/~f/search-this?i=LVTkyj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=SOKlsJ"><img src="http://feeds.feedburner.com/~f/search-this?i=SOKlsJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=ZsvbrJ"><img src="http://feeds.feedburner.com/~f/search-this?i=ZsvbrJ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/07/19/links-for-the-weekend-7-19-2008/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/07/19/links-for-the-weekend-7-19-2008/</feedburner:origLink></item>
		<item>
		<title>Fix Your CSS</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/335139646/</link>
		<comments>http://www.search-this.com/2008/07/14/fix-your-css/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 14:24:48 +0000</pubDate>
		<dc:creator>Paul OB</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[fixed positioning]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=679</guid>
		<description><![CDATA[Now that IE7 has overtaken IE6 in usage it has become more common to find authors trying to use position:fixed in their layouts. Therefore in this article we will try to address some common problems and misconceptions when using position:fixed (we will not be covering the background-attached "fixed" property but you can find out more [...]]]></description>
			<content:encoded><![CDATA[<p>Now that IE7 has overtaken IE6 in usage it has become more common to find authors trying to use <em><a href="http://reference.sitepoint.com/css/position">position:fixed</a></em> in their layouts. Therefore in this article we will try to address some common problems and misconceptions when using position:fixed (we will not be covering the background-attached "fixed" property but you can find out more about that <a href="http://reference.sitepoint.com/css/background-attachment">here</a> if you are interested.).</p>
<p><strong>Note that position:fixed doesn't work in IE6 and under so you will need to be using another browser although we will try to accommodate IE6 with some alternate styling.</strong></p>
<p><strong>Fixed to What?</strong></p>
<p>Fixed positioning varies from other positioned elements in that the element is always placed in relation to the viewport and not a local stacking context. Even if you add position:relative to a parent of the fixed element it is still placed in relation to the viewport.</p>
<p>This can present problems if you want to place the fixed element inside a centered layout and then place it at a certain position within that centered layout.</p>
<p>In order to have a positioned element inside a centered layout you can simply let it occupy its normal position in the flow and not specify any position values for <em>top</em>, <em>bottom</em>, <em>left</em> or <em>right</em> at all. This will enable the element to become fixed at that point while the rest of the content scrolls.</p>
<p>We'll work through some simple examples to show this in effect.</p>
<p>We'll start with this simple <strong><a href="http://www.pmob.co.uk/search-this/fixed1.htm">Example</a></strong></p>
<div class="igBar"><span id="lcss-10"><a href="#" onclick="javascript:showPlainTxt('css-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-10">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">body<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #993333;">center</span>;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#outer<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:600px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #993333;">auto</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border<span style="color: #3333ff;">:1px </span>solid #000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">relative</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#side<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">fixed</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-11"><a href="#" onclick="javascript:showPlainTxt('html-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-11">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"outer"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"side"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Fixed Sidebar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- add more elements to test scrolling--&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<strong>Figure 1</strong><br />
<a href='http://www.search-this.com/wp-content/uploads/2008/06/fix-figure1.gif'><img src="http://www.search-this.com/wp-content/uploads/2008/06/fix-figure1.gif" alt="" title="fix-figure1" width="464" height="223" class="alignnone size-full wp-image-680" /></a></p>
<p>As you can see from the example above this places the fixed element exactly at the top of our outer div and it remains there even though content will scroll.  Try scrolling the page up and down and you will see that the fixed element always remains in view.</p>
<p>Let's see what happens if we now try and add some positioning to move it into another position.</p>
<div class="igBar"><span id="lcss-12"><a href="#" onclick="javascript:showPlainTxt('css-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-12">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#side<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">fixed</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; left<span style="color: #3333ff;">:100px</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"></span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Figure 2</strong></p>
<p><a href='http://www.search-this.com/wp-content/uploads/2008/06/fix-figure2.gif'><img src="http://www.search-this.com/wp-content/uploads/2008/06/fix-figure2-300x90.gif" alt="" title="fix-figure2" width="300" height="90" class="alignnone size-medium wp-image-681" /></a></p>
<p>The fixed element has now jumped out of the centered container and is placed 100px from the left of the viewport. It ignored the centered container's position altogether! </p>
<p>This is because as mentioned above fixed elements are <em>always </em>placed in relation to the viewport so we cannot use <em>top</em>, <em>bottom </em><em>left </em>or <em>right</em> when we want to position within another element.</p>
<p><strong>Margins to The Rescue</strong></p>
<p>Fortunately we can use margins to push our fixed element around inside our centered block.</p>
<div class="igBar"><span id="lcss-13"><a href="#" onclick="javascript:showPlainTxt('css-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-13">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#side<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">fixed</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; margin-left<span style="color: #3333ff;">:100px</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"></span><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Figure 3</strong><br />
<a href='http://www.search-this.com/wp-content/uploads/2008/06/fix-figure3.gif'><img src="http://www.search-this.com/wp-content/uploads/2008/06/fix-figure3-300x113.gif" alt="" title="fix-figure3" width="300" height="113" class="alignnone size-medium wp-image-682" /></a></p>
<p>That pushes the element nicely into position as shown in Figure 3 above.</p>
<p>Although we have shown that the fixed element can in fact stay in tune with our centre element it should be noted that the fixed element won't be constrained by this parent and should content stretch the fixed element wide it would just overflow at the edges of the centred container. You would need to set a specific width if you wanted to constrain the width to match its current location.</p>
<p><strong>Fixed Footer</strong></p>
<p>We have now established that we can't use positioning inside our centered element so how can we place a fixed footer at the bottom of this container? A top margin can't be used this time because we don't know the height of the element and it will of course vary depending on content. If we use the position value of "bottom" then the fixed element will jump to the bottom of the viewport and not the bottom of the element we are concerned with.</p>
<p>In fact the answer lies once again in first using the normal rules of positioning to achieve the layout you want and then fixing the element once the layout is correct. </p>
<p>First of all we achieve the look we want without using fixed positioning.</p>
<p>One way this can be done is to absolutely position an element at the bottom of our layout and then add an inner element that is set to position:fixed. This means the element will be placed at the bottom of the layout and then it will be fixed at that exact position.</p>
<p>Here is the <strong><a href="http://www.pmob.co.uk/search-this/fixed2.htm">example</a></strong>:</p>
<div class="igBar"><span id="lcss-14"><a href="#" onclick="javascript:showPlainTxt('css-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-14">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#outer<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:600px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #993333;">auto</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border<span style="color: #3333ff;">:1px </span>solid #000;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">relative</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span>:<span style="color: #993333;">auto</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#base<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:50px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:600px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.inner<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">fixed</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:600px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:50px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-15"><a href="#" onclick="javascript:showPlainTxt('html-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-15">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"outer"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- add more elements to test scrolling--&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"base"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"inner"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Fixed base to centered element<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As you can see in Figure 4 the element is now placed at the bottom of our layout but because #outer isn't scrolling it appears to be doing nothing different from an absolute element.<br />
<strong><br />
Figure 4</strong><br />
<a href='http://www.search-this.com/wp-content/uploads/2008/06/fix-figure4.gif'><img src="http://www.search-this.com/wp-content/uploads/2008/06/fix-figure4.gif" alt="" title="fix-figure4" width="350" height="283" class="alignnone size-full wp-image-687" /></a><br />
If we shorten the viewport to  cause scrolling then we find that our fixed footer has been fixed below the viewport and is invisible as shown in Figure 5 or see for yourself in this <strong><a href="http://www.pmob.co.uk/search-this/fixed2.htm">Example 2</a></strong>.</p>
<p><strong>Figure 5</strong><br />
<a href='http://www.search-this.com/wp-content/uploads/2008/06/fix-figure5.gif'><img src="http://www.search-this.com/wp-content/uploads/2008/06/fix-figure5.gif" alt="" title="fix-figure5" width="350" height="252" class="alignnone size-full wp-image-688" /></a></p>
<p>This brings up an interesting problem when using fixed positioning in that when the element lies outside the viewport it becomes unreachable. Bear this in mind and always make sure you can reach the element in some way. This usually means making sure the fixed element is high in the viewport or is at least fixed to the viewport in some way.</p>
<p>We can't really use this method for our fixed footer because it serves no purpose if we can't see it. A change of tact is needed and we will need to fix the footer to the bottom of the viewport using the <em>bottom</em> property while not specifying left or right positions so that our element holds true to the centered layout. However we will also need to use a <strong>100% high</strong> centered layout if we want borders to meet the footer, otherwise it may look a bit detached. (Read my explanation on 100% height in the middle paragraphs <a href="http://www.search-this.com/2008/06/04/css-bordering-on-the-ridiculous/"><strong>here</strong></a>.)</p>
<p>Here is the <strong><a href="http://www.pmob.co.uk/search-this/fixed3.htm">example</a></strong> and the resulting code is as follows.</p>
<div class="igBar"><span id="lcss-16"><a href="#" onclick="javascript:showPlainTxt('css-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-16">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #cc66cc;color:#800000;">0</span>;padding:<span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">/* quick and dirty reset for demo only - use a proper reset */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">html,body<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">h1,p<span style="color: #66cc66;">&#123;</span>margin<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span><span style="color: #cc66cc;color:#800000;">0</span> 1em <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">body<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #993333;">center</span>;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#outer<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:600px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; min-<span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span>:<span style="color: #993333;">auto</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; border<span style="color: #3333ff;">:1px </span>solid #000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span>:<span style="color: #993333;">none</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span>:<span style="color: #993333;">none</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">relative</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html #outer<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span>:<span style="color: #cc66cc;color:#800000;">100</span>%<span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">/* for ie6 and under who will just get an absolute footer instead */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#base<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">fixed</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span>:50px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>:600px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">red</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* html #base<span style="color: #66cc66;">&#123;</span><span style="color: #808080; font-style: italic;">/* for ie6 and under*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span>:<span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p.last<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-bottom</span>:60px;<span style="color: #808080; font-style: italic;">/*make final text appear above footer */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-17"><a href="#" onclick="javascript:showPlainTxt('html-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-17">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"outer"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></a></span>Fix your CSS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>A small example of using position:fixed in compliant browsers (not IE6 and under)<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"last"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>scrolltest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- add more elements to test scrolling--&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"base"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span> Fixed base to centered element<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You will note from the above code I have added some padding to the last element so that the text is not covered up by the fixed element. Otherwise the last piece of text would sit underneath the footer and not be seen. I have also added a hack so that IE6 and under just gets a position absolute footer and will still be quite functional although it won't be a fixed footer. In dynamic situations (e.g. dynamically inserted content of JavaScript content switches) IE6 can forget where the absolute footer is so you need to take care when using it in dynamic situations. (Although as an aside I have found that if you are doing a content hide and show with javaScript you just need to nudge the footer with some JavaScript also and then it remembers where it was.)</p>
<p>If you really want IE to join the party then the easiest way is to use an IE expression to imitate <em>position:fixed</em>.</p>
<p>Here is another <strong><a href="http://www.pmob.co.uk/search-this/fixed4.htm">example</a></strong> that will work in IE6.</p>
<p>The expression is as follows.</p>
<div class="igBar"><span id="lcss-18"><a href="#" onclick="javascript:showPlainTxt('css-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-18">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!--<span style="color: #66cc66;">&#91;</span>if lte IE <span style="color: #cc66cc;color:#800000;">6</span><span style="color: #66cc66;">&#93;</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;style type=<span style="color: #ff0000;">"text/css"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">html<span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span>:<span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>fake.gif<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">/* use a 1px x 1px transparent gif which cures the jitters on the footer when using this expression*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#base <span style="color: #66cc66;">&#123;</span></span>position: <span style="color: #993333;">absolute</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">top</span>:expression<span style="color: #66cc66;">&#40;</span>eval<span style="color: #66cc66;">&#40;</span>document<span style="color: #6666ff;">.compatMode </span>&amp;&amp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">document.compatMode==<span style="color: #ff0000;">'CSS1Compat'</span><span style="color: #66cc66;">&#41;</span> ?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">documentElement<span style="color: #6666ff;">.scrollTop</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"></span>+<span style="color: #66cc66;">&#40;</span>documentElement.clientHeight-this.clientHeight<span style="color: #66cc66;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">: document.body<span style="color: #6666ff;">.scrollTop</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"></span>+<span style="color: #66cc66;">&#40;</span>document.body.clientHeight-this.clientHeight<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span>&nbsp;&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/style&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!<span style="color: #66cc66;">&#91;</span>endif<span style="color: #66cc66;">&#93;</span>--&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Be aware that expressions only work when javascript is enabled. You can read more about <strong><a href="http://reference.sitepoint.com/css/expression">expressions here</a></strong> and if you are also unfamiliar with conditional comments you can also read up on them <strong><a href="http://reference.sitepoint.com/css/conditionalcomments">here</a></strong>.</p>
<p>There is a CSS way of imitating position fixed in IE6 without using expressions or Javascript but it takes a lot of effort and is rather a risky process. If you want to take a look then I have some examples below but I will not explain them today (and they are mainly experimental and not something I would advocate using). However they are quite interesting.</p>
<p><strong><a href="http://www.pmob.co.uk/temp/fixed-footer-only.htm">Example1</a></strong><br />
<strong><a href="http://www.pmob.co.uk/temp/fixed-backtotop2.htm">Example 2</a></strong><br />
<strong><a href="http://www.pmob.co.uk/temp/3scrolling.htm">Example 3</a></strong><br />
<strong><a href="http://www.pmob.co.uk/temp/fixed-header-footer-left-new.htm">Example 4</a></strong></p>
<p>I hope that your CSS is now well and truly fixed!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=f0KwaJ"><img src="http://feeds.feedburner.com/~f/search-this?i=f0KwaJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=qzc9Cj"><img src="http://feeds.feedburner.com/~f/search-this?i=qzc9Cj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=UZomtJ"><img src="http://feeds.feedburner.com/~f/search-this?i=UZomtJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=2Be5tJ"><img src="http://feeds.feedburner.com/~f/search-this?i=2Be5tJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=xKJFJj"><img src="http://feeds.feedburner.com/~f/search-this?i=xKJFJj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=eXgp3j"><img src="http://feeds.feedburner.com/~f/search-this?i=eXgp3j" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=sSi2TJ"><img src="http://feeds.feedburner.com/~f/search-this?i=sSi2TJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=BJJGfJ"><img src="http://feeds.feedburner.com/~f/search-this?i=BJJGfJ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/07/14/fix-your-css/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/07/14/fix-your-css/</feedburner:origLink></item>
		<item>
		<title>Links for the Weekend, 7-5-2008</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/327594731/</link>
		<comments>http://www.search-this.com/2008/07/05/links-for-the-weekend-7-5-2008/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 20:40:13 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Links for the Weekend]]></category>

		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=702</guid>
		<description><![CDATA[
Diablo 3 - Oh Yeah!! Be sure to watch both videos!
Funniest Thing I've Seen in Awhile - Watch both videos and read what the guy did. Great Stuff!
Google Improved Flash Indexing - Very nice - very nice... 
Tiger Woods Website - He may be the best golfer in the world, but his website sucks...
Out Of [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://www.blizzard.com/diablo3/">Diablo 3</a> - Oh Yeah!! Be sure to watch both videos!</li>
<li><a href="http://theoffsiderules.blogspot.com/2008/07/hes-like-ribery-without-all-heaviness.html">Funniest Thing I've Seen in Awhile</a> - Watch both videos and read what the guy did. Great Stuff!</li>
<li><a href="http://googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html">Google Improved Flash Indexing</a> - Very nice - very nice... </li>
<li><a href="http://www.tigerwoods.com/defaultflash.sps">Tiger Woods Website</a> - He may be the best golfer in the world, but his website sucks...</li>
<li><a href="http://www.outofyourleaguegirlonconfidence.com/">Out Of Your League Girl On Confidence</a> - Um, strange...</li>
<li><a href="https://browsershots.org/">Browsershots</a> - Test your web design in different browsers...</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=UtpTVJ"><img src="http://feeds.feedburner.com/~f/search-this?i=UtpTVJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=fr1d8j"><img src="http://feeds.feedburner.com/~f/search-this?i=fr1d8j" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=OF6N6J"><img src="http://feeds.feedburner.com/~f/search-this?i=OF6N6J" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=KFFXMJ"><img src="http://feeds.feedburner.com/~f/search-this?i=KFFXMJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=uQLJNj"><img src="http://feeds.feedburner.com/~f/search-this?i=uQLJNj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=gwXiyj"><img src="http://feeds.feedburner.com/~f/search-this?i=gwXiyj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=25HNpJ"><img src="http://feeds.feedburner.com/~f/search-this?i=25HNpJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=z2qVlJ"><img src="http://feeds.feedburner.com/~f/search-this?i=z2qVlJ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/07/05/links-for-the-weekend-7-5-2008/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/07/05/links-for-the-weekend-7-5-2008/</feedburner:origLink></item>
		<item>
		<title>How Good Are You at JavaScript and CSS?</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/323261362/</link>
		<comments>http://www.search-this.com/2008/06/30/how-good-are-you-at-javascript-and-css/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 13:57:51 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Website Design]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=584</guid>
		<description><![CDATA[This year I have found myself looking for jobs on two separate occasions. As a result I have had a good number of interviews. One question that I found harder to answer than I had anticipated was when asked how good I am at JavaScript and CSS. 
Why was this question that hard to answer? [...]]]></description>
			<content:encoded><![CDATA[<p>This year I have found myself looking for jobs on two separate occasions. As a result I have had a good number of interviews. One question that I found harder to answer than I had anticipated was when asked how good I am at JavaScript and CSS. </p>
<p>Why was this question that hard to answer? I actually feel that I am quite knowledgeable about both CSS and JavaScript. I've built probably close to a dozen websites using entirely CSS-based layouts over the last few years. In addition, I have used JavaScript quite often to enhance those websites, usually with Ajax and spiffy web widgets like the <a href="http://www.search-this.com/comment-info-tip/">Comment Info Tip Plugin</a>. I may not be as knowledgeable as <a href="http://www.search-this.com/category/css/">Paul O'Brien</a> when it comes to CSS or <a href="http://snook.ca/jonathan/">Jonathan Snook</a> when it comes to JavaScript, but I certainly am competent. So again, what's the problem?</p>
<p>The problem is the damn cross-browser problems that still trip a person up from time to time. Almost every time I ask Paul for his help with CSS it has to do with a cross-browser issue: something works in Firefox, but not in IE or vice versa. Same with JavaScript; think <em>addEventListener </em>method in Firefox and <em>attachEvent </em>for Internet Explorer. This is a bloody mess for the developer and I suppose makes me question my abilities at times. </p>
<p>Such cross-browser issues make it hard for a developer. I don't know about you, but I've often spent more time trying to make a site work across all browsers than on the actual design of the site. </p>
<p>There are people that I know and respect that have chosen not to learn JavaScript at all because they were so put off by such difficulties. Also consider how difficult it's been to get people to leave HTML table-based designs behind in favor of CSS layouts. It's been slow at best. No doubt due much to the differences across browsers.</p>
<p><strong>What's your take? How has the difficulties in trying to achieve all browser support effected your attitude of CSS and JavaScipt?</strong></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=ImY7dI"><img src="http://feeds.feedburner.com/~f/search-this?i=ImY7dI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=Ekcjvi"><img src="http://feeds.feedburner.com/~f/search-this?i=Ekcjvi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=T61IeI"><img src="http://feeds.feedburner.com/~f/search-this?i=T61IeI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=0o13eI"><img src="http://feeds.feedburner.com/~f/search-this?i=0o13eI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=zm1xmi"><img src="http://feeds.feedburner.com/~f/search-this?i=zm1xmi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=gbyy9i"><img src="http://feeds.feedburner.com/~f/search-this?i=gbyy9i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=haF3kI"><img src="http://feeds.feedburner.com/~f/search-this?i=haF3kI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=oKNilI"><img src="http://feeds.feedburner.com/~f/search-this?i=oKNilI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/30/how-good-are-you-at-javascript-and-css/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/30/how-good-are-you-at-javascript-and-css/</feedburner:origLink></item>
		<item>
		<title>Links for the Weekend, 6-28-2008</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/322023567/</link>
		<comments>http://www.search-this.com/2008/06/28/links-for-the-weekend-6-28-2008/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 13:37:30 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Links for the Weekend]]></category>

		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=701</guid>
		<description><![CDATA[
photoShuffle - Nice Flash photo album...
Ironman Desktop Wallpaper - Good movie, good wallpaper.
Aaron Cannon’s Web Accessibility Checklist - Aaron Cannon is a blind web developer and accessibility consultant. 
The Clone Wars Trailer - Let's just hope Lucas didn't write it.
The Clone Wars Trailer 2 - How long until video games look this good?
What are C# [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://www.flashframer.com/flash-components/photoshuffle/">photoShuffle</a> - Nice Flash photo album...</li>
<li><a href="http://ironmanmovie.marvel.com/downloads/desktops/d3_1280.html">Ironman Desktop Wallpaper</a> - Good movie, good wallpaper.</li>
<li><a href="http://cameronmoll.com/archives/2008/06/web_accessibility_checklist/">Aaron Cannon’s Web Accessibility Checklist</a> - Aaron Cannon is a blind web developer and accessibility consultant. </li>
<li><a href="http://www.starwars.com/video/view/000478.html">The Clone Wars Trailer</a> - Let's just hope Lucas didn't write it.</li>
<li><a href="http://www.starwars.com/video/view/000647.html">The Clone Wars Trailer 2</a> - How long until video games look this good?</li>
<li><a href="http://www.codersbarn.com/post/2008/04/What-are-C-Generics---Part-I.aspx">What are C# Generics - Part I</a> - Nice article...</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=1QdfPI"><img src="http://feeds.feedburner.com/~f/search-this?i=1QdfPI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=T5x27i"><img src="http://feeds.feedburner.com/~f/search-this?i=T5x27i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=EqeMTI"><img src="http://feeds.feedburner.com/~f/search-this?i=EqeMTI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=Ir1Z1I"><img src="http://feeds.feedburner.com/~f/search-this?i=Ir1Z1I" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=XcrxZi"><img src="http://feeds.feedburner.com/~f/search-this?i=XcrxZi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=9vgJ7i"><img src="http://feeds.feedburner.com/~f/search-this?i=9vgJ7i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=19b8JI"><img src="http://feeds.feedburner.com/~f/search-this?i=19b8JI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=gmzUJI"><img src="http://feeds.feedburner.com/~f/search-this?i=gmzUJI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/28/links-for-the-weekend-6-28-2008/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/28/links-for-the-weekend-6-28-2008/</feedburner:origLink></item>
		<item>
		<title>10 Things Any Web Developer Worth Their Spit Should Know</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/318917942/</link>
		<comments>http://www.search-this.com/2008/06/24/10-things-any-web-developer-worth-their-spit-should-know/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 14:16:42 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Website Design]]></category>

		<category><![CDATA[web design]]></category>

		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=678</guid>
		<description><![CDATA[

DOCTYPE Declaration
DOCTYPE (short for “document type declaration”) informs the browser of which HTML or XHTML standards you would like your code to be checked against. You're essentially declaring to the browser that these are the rules that you have used to create this page and in return you are expecting that it will render accordingly. [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>
<h3>DOCTYPE Declaration</h3>
<p>DOCTYPE (short for “document type declaration”) informs the browser of which HTML or XHTML standards you would like your code to be checked against. You're essentially declaring to the browser that these are the rules that you have used to create this page and in return you are expecting that it will render accordingly. Failure to specify a DOCTYPE can lead to unexpected rendering -- a developers worst nightmare.</p>
<p>[ <a href="http://www.alistapart.com/articles/doctype/">further reading</a> ]
</li>
<li>
<h3>Navigation</h3>
<p>A website's navigation plays a key role in the success or failure of a site. It allows humans and search engines alike to easily locate the desired information. Or it doesn't. Navigations made up of Flash or JavaScript/DHTML may seem attractive at first, but ultimately can cripple a website by not allowing search engines to crawl and index the entire site. In addition, viewers that choose not to partake in these technologies can be left with no means to move within the site. </p>
<p>Most experienced webmasters have left such navigations back in the 90's with all those AOL discs.
</li>
<li>
<h3>CSS is Not an Option</h3>
<p>In the past webmasters could choose to ignore CSS if they so desired. Those days are gone. CSS is no longer an option, it's part of the trifecta (see The Separation of Concerns for the trifecta) that makes up a quality website. A good webmaster will use CSS exclusively to define the look and layout of a website.
</li>
<li>
<h3>The Separation of Concerns</h3>
<p>In days gone by web developers would meld HTML, CSS, and JavaScript code all into a single page; like a web page jambalaya. Inexperienced web developers may still do this, but the experienced ones took notice that the make up of any given page is defined by three elements: the <em>content </em>of the page, the <em>presentation </em>of that content and the <em>behavior </em>of that content.</p>
<p>Realizing this, competent developers have made an effort to keep these three layers separate from one another.  Kevin Yank does a fine job explaining our three layers in his article: <a href="http://www.sitepoint.com/article/simply-javascript"><em>Simply JavaScript: The Three Layers of the Web</em></a></p>
<blockquote><p>
When building a site, we work through these layers from the bottom up:</p>
<p>   1. We start by producing the <em>content </em>in HTML format. This is the base layer, which any visitor using any kind of browser should be able to view.</p>
<p>   2. With that done, we can focus on making the site look better, by adding a layer of <em>presentation </em>information using CSS. The site will now look good to users able to display CSS styles.</p>
<p>   3. Lastly, we can use JavaScript to introduce an added layer of interactivity and dynamic <em>behavior</em>, which will make the site easier to use in browsers equipped with JavaScript.
</p></blockquote>
</li>
<li>
<h3>Cross-Browser Support</h3>
<p>Any developer that has been building websites for awhile has the battle scars that you get when you try and make your website work on all browsers. Each browser has it's own idiosyncrasies (some more than others) and designing and redesigning your site to function under each can be a battle; but it's a battle that must be fought and won. </p>
<p>[ <a href="http://www.search-this.com/2007/03/12/no-margin-for-error/">for more help with cross-browser CSS read this</a> ]
</li>
<li>
<h3>It's Not About You</h3>
<p>A common trait of the rookie developer is they think the design of a website is about them. That through the design of the site they somehow get the chance to express themselves. The professional realizes that it would be a huge mistake to design the site in such a way that pleases them only to neglect the site's visitors.</p>
<p>As a developer you must heed the words of Spock in <em><a href="http://en.wikipedia.org/wiki/Star_Trek_II:_The_Wrath_of_Khan">The Wrath of Khan</a></em> that the good of the many outweighs the good of the few, or the one. You are the one, the website's viewers are the many; make the website for them, not you.
</li>
<li>
<h3>Standards Are There For A Reason</h3>
<p>Let established web standards be your true north when you're deciding which way to go. Users, when they visit a website, expect a standard convention. For example, the main navigation we expect to be along the top or left hand side of the page, a search box above the fold and vertical scrolling. These are a few of the design traits we have come to expect, been conditioned to expect in Pavlovian fashion. Don't fight this, don't make us think, remember these have become the standards because they work, not because they don't work.
</li>
<li>
<h3>Validation</h3>
<p>Validation is not just a niceness, it's a necessity. Paul O'Brien has done an excellent job explaining the significance of validation in his article <a href="http://www.search-this.com/2008/04/24/why-validate/">Why Validate</a>.
</li>
<li>
<h3>Keep It Simple</h3>
<p>The novice developer can often feel compelled to flex their design muscles in an attempt to prove themselves. Far too often this can be reflected in bloated pages that are not easy to read, navigate or load. It is a great challenge to design a site that is visually appealing and yet serves to enhance the readability, not take away from it. Sites that cannot be easily scanned or navigated that cause a slow down in the browsing process run the risk of losing audience. The experienced developer has come to learn this, often the hard way. The novice will learn this, in time.
</li>
<li>
<h3>Nobody's Reading This</h3>
<p>Perhaps the biggest giveaway that a website was done by a rookie developer is the verbose content. The novice developer will often try and turn the company's preexisting marketing material into the website's context without efficiently editing it for the web. Good offline marketing doesn't always translate to good online marketing where users are impatient and looking for instant gratification.</p>
<p>In a study done by Penn State University they concluded that web users are picky and impatient;  one in five searchers spend 60 seconds or less on a document.</p>
<blockquote><p>“People make instantaneous judgments about whether to stay on a site, and if a site doesn’t give the right impression, users will bypass it," said Dr. Jim Jansen, assistant professor in Penn State’s information sciences and technology (IST). "A page has to be well-designed, easy to load and relevant to a searcher’s needs."</p>
<p>Otherwise, by the time three minutes have elapsed, 40 percent of searchers will have moved on. While some may have found what they wanted, others may simply have given up and moved to a different site, said the faculty member in Penn State’s School of Information Sciences and Technology (IST).</p></blockquote>
<p>[ <a href="http://www.search-this.com/website-promotion/impatient-web-searchers-measure-web-sites-appeal-in-seconds/">more here </a>]
</li>
</ol>
<p>Those are our ten things any web developer worth their spit should know. What do you think? Did we leave anything off the list that you think we should have included?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=ev9z4I"><img src="http://feeds.feedburner.com/~f/search-this?i=ev9z4I" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=0ypTBi"><img src="http://feeds.feedburner.com/~f/search-this?i=0ypTBi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=jwDC1I"><img src="http://feeds.feedburner.com/~f/search-this?i=jwDC1I" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=0QPfVI"><img src="http://feeds.feedburner.com/~f/search-this?i=0QPfVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=re5f1i"><img src="http://feeds.feedburner.com/~f/search-this?i=re5f1i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=wXCv7i"><img src="http://feeds.feedburner.com/~f/search-this?i=wXCv7i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=auRFiI"><img src="http://feeds.feedburner.com/~f/search-this?i=auRFiI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=6E9ywI"><img src="http://feeds.feedburner.com/~f/search-this?i=6E9ywI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/24/10-things-any-web-developer-worth-their-spit-should-know/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/24/10-things-any-web-developer-worth-their-spit-should-know/</feedburner:origLink></item>
		<item>
		<title>Links for the Weekend, 6-21-2008</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/316966632/</link>
		<comments>http://www.search-this.com/2008/06/21/links-for-the-weekend-6-21-2008/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 16:47:12 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Links for the Weekend]]></category>

		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=700</guid>
		<description><![CDATA[
Golden Ratio Calculator - Nice idea...
Microsoft Visual C# Under the Covers: An In-Depth Look at C# 3.0 - Video - about 1 hour long.
LINQ to SQL: Accessing Relational Data with Language Integrated Query - Another 1 hour long video on LINQ. 
Thrasher Magazine - How many people got this mag when they were a kid? [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://goldenratiocalculator.com/">Golden Ratio Calculator</a> - Nice idea...</li>
<li><a href="http://www.microsoft.com/emea/msdn/spotlight/sessionh.aspx?videoid=710">Microsoft Visual C# Under the Covers: An In-Depth Look at C# 3.0</a> - Video - about 1 hour long.</li>
<li><a href="http://www.microsoft.com/emea/msdn/spotlight/sessionh.aspx?videoid=716">LINQ to SQL: Accessing Relational Data with Language Integrated Query</a> - Another 1 hour long video on LINQ. </li>
<li><a href="http://www.thrashermagazine.com/">Thrasher Magazine</a> - How many people got this mag when they were a kid? I did.</li>
<li><a href="http://www.youtube.com/watch?v=uTsd_bkGdtI">Powell-Peralta Future Primitive</a> - Yes I'm reminiscing about my skateboard days; ah good times...</li>
<li><a href="http://www.fuelyourcreativity.com/23-kick-ass-portfolio-designs/">24 Kick Ass Portfolio Designs</a> - Some great work here...</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=MEAEQI"><img src="http://feeds.feedburner.com/~f/search-this?i=MEAEQI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=RwCNfi"><img src="http://feeds.feedburner.com/~f/search-this?i=RwCNfi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=bE2eWI"><img src="http://feeds.feedburner.com/~f/search-this?i=bE2eWI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=0SKtxI"><img src="http://feeds.feedburner.com/~f/search-this?i=0SKtxI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=BVjzLi"><img src="http://feeds.feedburner.com/~f/search-this?i=BVjzLi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=TBt3Ni"><img src="http://feeds.feedburner.com/~f/search-this?i=TBt3Ni" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=jgusiI"><img src="http://feeds.feedburner.com/~f/search-this?i=jgusiI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=iZ6KSI"><img src="http://feeds.feedburner.com/~f/search-this?i=iZ6KSI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/21/links-for-the-weekend-6-21-2008/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/21/links-for-the-weekend-6-21-2008/</feedburner:origLink></item>
		<item>
		<title>Nicely-Fitting Background Images</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/313894200/</link>
		<comments>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 16:07:48 +0000</pubDate>
		<dc:creator>Raffles</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Search Engine Optimization]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=696</guid>
		<description><![CDATA[In recent thread over at the SitePoint forums, someone asked how to have any sized image fit nicely into the viewport while maintaining its aspect ratio. The assumption is that all the content can fit in the viewport and no scrollbars are needed. While CSS is wonderful and magical, it doesn't know the sizes of [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">In <a href="http://www.sitepoint.com/forums/showthread.php?t=552791">recent thread</a> over at the SitePoint forums, someone asked how to have any sized image fit nicely into the viewport while maintaining its aspect ratio. The assumption is that all the content can fit in the viewport and no scrollbars are needed. While CSS is wonderful and magical, it doesn't know the sizes of images and let us play with them to pixel perfection, so we must turn to good old JavaScript to maintain aspect ratio.</p>
<p style="text-align: left;">
<p style="text-align: left;"><a title="Note: 800KB image!" href="http://www.search-this.com/wp-content/uploads/2008/06/apurimac-150x150.jpg">This</a> is a very large photo I took of a mountain near <a title="Choquequirao in the Peruvian Andes" href="http://en.wikipedia.org/wiki/Choquequirao">Choquequirao</a>, Peru. Figure 1 shows it set as a normal background image without playing with CSS's <code>background-position</code> or anything else and only a rather boring corner of it (not that the whole image is that exciting either) is visible:</p>
<p style="text-align: center;"><a href="http://www.search-this.com/wp-content/uploads/2008/06/cssonly1.htm"><img class="size-full wp-image-685 aligncenter" title="Go to a sample page" src="http://www.search-this.com/wp-content/uploads/2008/06/fig1.png" alt="" width="307" height="230" /></a></p>
<p style="text-align: center;"><strong>Figure 1</strong></p>
<p style="text-align: left;">Figure 2 shows the same thing, except that the image has been centred using <code>background-position:center</code>:</p>
<p style="text-align: center;"><a href="http://www.search-this.com/wp-content/uploads/2008/06/cssonly2.htm"><img class="alignnone size-medium wp-image-691 aligncenter" title="Huge image, now centred" src="http://www.search-this.com/wp-content/uploads/2008/06/fig2-300x224.png" alt="Huge image, now centred" width="300" height="224" /></a></p>
<p style="text-align: center;"><strong>Figure 2</strong></p>
<p style="text-align: left;">It's even more boring! Now, with CSS we can still improve this a bit, by using the <code>img</code> element instead of a background image. Yes, this is not as beautifully semantic, but for the purposes of this example will do:</p>
<p style="text-align: left;">
<div class="igBar"><span id="lhtml-22"><a href="#" onclick="javascript:showPlainTxt('html-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-22">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">&lt;body&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"bg"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"apurimac.jpg"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"main"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>Main content, overlapping background image<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p style="text-align: left;">By setting the <code>width</code> and <code>height</code> of <code>#bg</code> and the image to 100%, we can <a title="Full-size but stretched" href="http://www.search-this.com/wp-content/uploads/2008/06/cssonly3.html">fill the viewport up with the image</a>, but of course the aspect ratio of the image will not be maintained and the stretchiness can look horrible, particularly if the browser window is resized.</p>
<p style="text-align: left;">Time for some JavaScript, then. The first thing to do is to make sure the image has actually loaded before we try to resize it. I've decided on the following approach:</p>
<p style="text-align: left;">
<div class="igBar"><span id="ljavascript-23"><a href="#" onclick="javascript:showPlainTxt('javascript-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-23">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> bgimg;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> init = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; bg = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'bg'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; bgimg = bg.<span style="color: #006600;">firstChild</span>.<span style="color: #006600;">nextSibling</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; bgimg.<span style="color: #000066;">onload</span> = resizeBg;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; bgimg.<span style="color: #006600;">src</span> = bgimg.<span style="color: #006600;">src</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#41;</span> window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'resize'</span>, resizeBg, <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>window.<span style="color: #006600;">attachEvent</span><span style="color: #66cc66;">&#41;</span> window.<span style="color: #006600;">attachEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'onresize'</span>, resizeBg<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p style="text-align: left;">The key thing here is that we first set an <code>onload</code> event listener on <code>bgimg</code> (the image we're resizing) which will fire when the image has finished loading. However, it will only fire if the <code>src</code> attribute is set, so we do that in the following line (it doesn't matter that it's the same <code>src</code>, fortunately).</p>
<p style="text-align: left;">The last three lines fire <code>resizeBg</code> when the browser window is resized and cater for decent browsers and IE. Here is <code>resizeBg</code>:</p>
<p style="text-align: left;">
<div class="igBar"><span id="ljavascript-24"><a href="#" onclick="javascript:showPlainTxt('javascript-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-24">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> resizeBg = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> w = self.<span style="color: #006600;">innerWidth</span> || document.<span style="color: #006600;">documentElement</span>.<span style="color: #006600;">clientWidth</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> h = self.<span style="color: #006600;">innerHeight</span> || document.<span style="color: #006600;">documentElement</span>.<span style="color: #006600;">clientHeight</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>bgimg.<span style="color: #006600;">width</span> !== w<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">parentNode</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">left</span> = <span style="color: #3366CC;">'0'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">parentNode</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">top</span> = <span style="color: #3366CC;">'0'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">height</span> = <span style="color: #66cc66;">&#40;</span>w / bgimg.<span style="color: #006600;">width</span><span style="color: #66cc66;">&#41;</span> * bgimg.<span style="color: #006600;">height</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">width</span> = w;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>bgimg.<span style="color: #006600;">height</span> &lt;h<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">width</span> = <span style="color: #66cc66;">&#40;</span>h / bgimg.<span style="color: #006600;">height</span><span style="color: #66cc66;">&#41;</span> * bgimg.<span style="color: #006600;">width</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">height</span> = h;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">parentNode</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">left</span> = <span style="color: #3366CC;">'-'</span> + <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>bgimg.<span style="color: #006600;">width</span> - w<span style="color: #66cc66;">&#41;</span> / <span style="color: #CC0000;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'px'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>bgimg.<span style="color: #006600;">height</span>&gt; h<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bgimg.<span style="color: #006600;">parentNode</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">top</span> = <span style="color: #3366CC;">'-'</span> + <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>bgimg.<span style="color: #006600;">height</span> - h<span style="color: #66cc66;">&#41;</span> / <span style="color: #CC0000;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'px'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p style="text-align: left;">The first two lines obtain the width and height of the viewport. There is a small caveat here: For <code>document.documentElement.clientWidth</code> to work (since IE does not support <code>self.innerX</code>), IE must not be in quirks mode, i.e. the page must have a valid doctype. Not much of a caveat, really, since your pages should have valid doctypes anyway.</p>
<p style="text-align: left;">Following that, we just employ some simple mathematics. The first <code>if</code> block will set any image to the same width as the viewport. It also works out the new height for the image so that the aspect ratio is preserved.</p>
<p style="text-align: left;">The next <code>if-else</code> block is important. If the first block's calculations means that the new image's height is smaller than the viewport, we need to make it a bit bigger. This means setting the width to bigger than the viewport, so to preserve the aspect ratio, we centre it by shifting it left by half the difference.</p>
<p style="text-align: left;">If the height of the new image is bigger, then we need to centre it vertically, which is what the <code>else if</code> bit does.</p>
<p style="text-align: left;">Now, as shown in Figure 3, we can get a nicely-fitting centred image as the background!</p>
<p style="text-align: center;"><a href="http://www.search-this.com/wp-content/uploads/2008/06/fsbg.html"><img class="alignnone size-medium wp-image-699 aligncenter" title="Full-screen background images thumb" src="http://www.search-this.com/wp-content/uploads/2008/06/fig3-300x224.png" alt="Full-screen background images thumb" width="300" height="224" /></a></p>
<p style="text-align: center;"><strong>Figure 3</strong></p>
<p style="text-align: left;">See the <a title="Finished example page" href="http://www.search-this.com/wp-content/uploads/2008/06/fsbg.html">finished example page</a> (which Figure 3 links to too) and the <a title="Full-size background image script" href="http://www.search-this.com/wp-content/uploads/2008/06/fsbg.js">accompanying JavaScript</a> file. The JavaScript file includes code to run the resizing function when the DOM has loaded, using <a href="http://dean.edwards.name/weblog/2006/06/again/">Dean Edwards' script</a>, so the <code>init</code> function will look a little different to the one on this page.</p>
<p style="text-align: left;">Before anyone says anything, yes, the script could be made truly nice and unobtrusive by creating the HTML elements for the background image with JavaScript as well, but that is not the focus of this post, so it can be left as an exercise for the reader!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=l6TUTI"><img src="http://feeds.feedburner.com/~f/search-this?i=l6TUTI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=AYFlLi"><img src="http://feeds.feedburner.com/~f/search-this?i=AYFlLi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=rEIOMI"><img src="http://feeds.feedburner.com/~f/search-this?i=rEIOMI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=KLXr4I"><img src="http://feeds.feedburner.com/~f/search-this?i=KLXr4I" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=TTBGxi"><img src="http://feeds.feedburner.com/~f/search-this?i=TTBGxi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=gUXXGi"><img src="http://feeds.feedburner.com/~f/search-this?i=gUXXGi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=FRmA7I"><img src="http://feeds.feedburner.com/~f/search-this?i=FRmA7I" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=sCO45I"><img src="http://feeds.feedburner.com/~f/search-this?i=sCO45I" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/</feedburner:origLink></item>
		<item>
		<title>Firefox 3 Opens Tomorrow</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/313370561/</link>
		<comments>http://www.search-this.com/2008/06/16/firefox-3-opens-tomorrow/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 23:22:26 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Firefox 3]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=695</guid>
		<description><![CDATA["Just more than 10 years ago, Mozilla threw its open-source code into the public domain. Today, its browser -- Firefox -- is preparing to launch its third major release in hopes of continuing to eat away at Microsoft's Internet Explorer.
Firefox already has more than 18 percent of the global market, according to Net Applications. With [...]]]></description>
			<content:encoded><![CDATA[<p>"Just more than 10 years ago, Mozilla threw its open-source code into the public domain. Today, its browser -- Firefox -- is preparing to launch its third major release in hopes of continuing to eat away at Microsoft's Internet Explorer.</p>
<p>Firefox already has more than 18 percent of the global market, according to Net Applications. With the release of Firefox 3, Mozilla could see a boost in downloads and market share. Microsoft's next version of Internet Explorer won't come to market until later this year.</p>
<p>Tomorrow, Mozilla will release Firefox 3. After more than 34 months of active development and the contributions of thousands of people, Firefox 3 will be downloadable free from the Mozilla Web site. Mozilla is promising this is the best browser -- period."</p>
<p>[ more <a href="http://news.yahoo.com/s/nf/20080612/bs_nf/60269">here</a> and <a href="http://www.dria.org/wordpress/archives/2008/06/12/655/">here</a>]</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=5eYssI"><img src="http://feeds.feedburner.com/~f/search-this?i=5eYssI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=88MwSi"><img src="http://feeds.feedburner.com/~f/search-this?i=88MwSi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=8dbakI"><img src="http://feeds.feedburner.com/~f/search-this?i=8dbakI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=yXGlWI"><img src="http://feeds.feedburner.com/~f/search-this?i=yXGlWI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=9h73pi"><img src="http://feeds.feedburner.com/~f/search-this?i=9h73pi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=ZFRAei"><img src="http://feeds.feedburner.com/~f/search-this?i=ZFRAei" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=WhXzWI"><img src="http://feeds.feedburner.com/~f/search-this?i=WhXzWI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=9h6vHI"><img src="http://feeds.feedburner.com/~f/search-this?i=9h6vHI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/16/firefox-3-opens-tomorrow/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/16/firefox-3-opens-tomorrow/</feedburner:origLink></item>
		<item>
		<title>3 C# 3.0 Shortcuts</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/313249480/</link>
		<comments>http://www.search-this.com/2008/06/16/3-c-30-shortcuts/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 19:37:40 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[automatic properties]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=690</guid>
		<description><![CDATA[1. Automatic Properties
Automatic properties provide you with a shorthand for defining a new property. No more do we have to create the private property and then use Getters and Setters to access and set that property. Here's the old code:
PLAIN TEXT
ASP:




private string _Name;


&#160;


public string Name


&#123;


&#160; get &#123;return _Name;&#125;


&#160; set &#123;_Name = value;&#125;


&#125; 






Now here's the [...]]]></description>
			<content:encoded><![CDATA[<h3>1. Automatic Properties</h3>
<p>Automatic properties provide you with a shorthand for defining a new property. No more do we have to create the <em>private</em> property and then use Getters and Setters to access and set that property. Here's the old code:</p>
<div class="igBar"><span id="lasp-30"><a href="#" onclick="javascript:showPlainTxt('asp-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-30">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">private</span> <span style="color:#990099; font-weight:bold;">string</span> _Name;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">public</span> <span style="color:#990099; font-weight:bold;">string</span> Name</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">get</span> <span style="color:#006600; font-weight:bold;">&#123;</span>return _Name;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#990099; font-weight:bold;">set</span> <span style="color:#006600; font-weight:bold;">&#123;</span>_Name = <span style="color:#330066;">value</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now here's the code using automatic properties:</p>
<div class="igBar"><span id="lasp-31"><a href="#" onclick="javascript:showPlainTxt('asp-31'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-31">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#990099; font-weight:bold;">public</span> <span style="color:#990099; font-weight:bold;">string</span> Name <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#990099; font-weight:bold;">get</span>; <span style="color:#990099; font-weight:bold;">set</span>;<span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Oh my! How nice is that? The C# compiler creates the Getters and Setters and the private fields for you automagically!</p>
<h3>2. Initializers</h3>
<p>We've talked about initializers <a href="http://www.search-this.com/2008/02/08/initialize-objects-with-c-30/">before</a>, but let's review anyway. You can use initializers to reduce the amount of work it takes to create a new instance of a class. Instead of this:</p>
<div class="igBar"><span id="lasp-32"><a href="#" onclick="javascript:showPlainTxt('asp-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-32">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Customer Mark = <span style="color:#0000FF; font-weight:bold;">new</span> Customer<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Mark.<span style="color:#9900CC;">Id</span> = <span style="color:#800000;color:#800000;">12</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Mark.<span style="color:#9900CC;">Kids</span> = <span style="color:#800000;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Mark.<span style="color:#9900CC;">Money</span> = <span style="color:#800000;color:#800000;">1000000</span>.00m; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>We can do this:</p>
<div class="igBar"><span id="lasp-33"><a href="#" onclick="javascript:showPlainTxt('asp-33'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-33">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Customer Mark = <span style="color:#0000FF; font-weight:bold;">new</span> Customer <span style="color:#006600; font-weight:bold;">&#123;</span>Id=<span style="color:#800000;color:#800000;">12</span>, Kids=<span style="color:#800000;color:#800000;">2</span>, Money=<span style="color:#800000;color:#800000;">1000000</span>.00m<span style="color:#006600; font-weight:bold;">&#125;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Short and sweet -- the way I like it.</p>
<h3>3. Type Inference</h3>
<p>This new feature takes a page out of JavaScript's book. When you take advantage of type inference, you allow the C# compiler to determine the type of variable at compile time. Here's an example of how you use type inference with C#:</p>
<div class="igBar"><span id="lasp-34"><a href="#" onclick="javascript:showPlainTxt('asp-34'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASP:</span>
<div id="asp-34">
<div class="asp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF; font-weight:bold;">var</span> message = <span style="color:#CC0000;">"Hello World!"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Looks like JavaScript eh? Notice that we didn't declare a type? The C# compiler can infer the type of variable (it's a string) from the value you use to initialize the variable.</p>
<p>No performance impact results from using type inference. The compiler does all the work figuring out the data type at compile time.</p>
<p>Notice the use of the keyword var? You declare a variable of type var when you want the compiler to figure out the variable's data type all by itself.</p>
<p>Enjoy those three shorthand shortcuts and happy coding.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=XA7O1I"><img src="http://feeds.feedburner.com/~f/search-this?i=XA7O1I" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=komdqi"><img src="http://feeds.feedburner.com/~f/search-this?i=komdqi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=DRVCcI"><img src="http://feeds.feedburner.com/~f/search-this?i=DRVCcI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=CbtXYI"><img src="http://feeds.feedburner.com/~f/search-this?i=CbtXYI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=ZacRAi"><img src="http://feeds.feedburner.com/~f/search-this?i=ZacRAi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=br7npi"><img src="http://feeds.feedburner.com/~f/search-this?i=br7npi" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=GcteEI"><img src="http://feeds.feedburner.com/~f/search-this?i=GcteEI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=HCBJsI"><img src="http://feeds.feedburner.com/~f/search-this?i=HCBJsI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/16/3-c-30-shortcuts/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/16/3-c-30-shortcuts/</feedburner:origLink></item>
		<item>
		<title>Out of Office Reply</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/311937801/</link>
		<comments>http://www.search-this.com/2008/06/14/out-of-office-reply/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 13:59:42 +0000</pubDate>
		<dc:creator>Golgotha</dc:creator>
		
		<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.search-this.com/?p=689</guid>
		<description><![CDATA[I'm unavailable, can't be reached, no emails, no instant messages, no voice mail, i'm 404...
Sorry guys for the slow week, but I just had an addition to the family. My wife and I just had a baby boy! His name is Landon Sean Angeletti and he's fantastic. I'll be back in action next week. I'll [...]]]></description>
			<content:encoded><![CDATA[<p>I'm unavailable, can't be reached, no emails, no instant messages, no voice mail, i'm 404...</p>
<p>Sorry guys for the slow week, but I just had an addition to the family. My wife and I just had a baby boy! His name is Landon Sean Angeletti and he's fantastic. I'll be back in action next week. I'll cya then.</p>
<p>Mark </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/search-this?a=4zfkEI"><img src="http://feeds.feedburner.com/~f/search-this?i=4zfkEI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=xI9G5i"><img src="http://feeds.feedburner.com/~f/search-this?i=xI9G5i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=HKP9iI"><img src="http://feeds.feedburner.com/~f/search-this?i=HKP9iI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=QaS2wI"><img src="http://feeds.feedburner.com/~f/search-this?i=QaS2wI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=xuac7i"><img src="http://feeds.feedburner.com/~f/search-this?i=xuac7i" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=8fmOki"><img src="http://feeds.feedburner.com/~f/search-this?i=8fmOki" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=AxU38I"><img src="http://feeds.feedburner.com/~f/search-this?i=AxU38I" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/search-this?a=BTSimI"><img src="http://feeds.feedburner.com/~f/search-this?i=BTSimI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.search-this.com/2008/06/14/out-of-office-reply/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.search-this.com/2008/06/14/out-of-office-reply/</feedburner:origLink></item>
		<item>
		<title>Links for the Weekend, 6-7-2008</title>
		<link>http://feeds.feedburner.com/~r/search-this/~3/306793811/</link>
		<comments>http://www.search-this.com/2008/06/07/links