<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>John's Technology Blog</title>
<link>http://www.blog.johnavis.com/</link>
<description>My blog including my Classic ASP tips and tricks, sample scripts, and applications, plus JavaScript; and my experiences with buying and selling on eBay and using PayPal.</description>
<item>
<title>100% CSS Layout</title>
<link>http://www.blog.johnavis.com/blog/default.asp?id=397</link>
<description>I had been looking for a CSS layout that has three components - a header, footer and content area - and the following characteristics:
&lt;ul&gt;
&lt;li&gt;When the content in the content area does not fill the available window space the footer should be set to the bottom of the page.&lt;/li&gt;
&lt;li&gt;When the content overflows the footer should be positioned at the end of the document, off the screen.&lt;/li&gt;
&lt;li&gt;The content area should fill at least all remaining window space so that any object I put inside it can scale to 100% of its height.&lt;/li&gt;
&lt;li&gt;The content area should have a minimum height so that it won't look silly in a very tiny window (unlikely)&lt;/li&gt;
&lt;li&gt;If the user resizes the browser the content area should resize.&lt;/li&gt;
&lt;/ul&gt;
I couldn't find a pure CSS solution so I came up with a solution that uses CSS and JavaScript.
&lt;p&gt;
&lt;a href=&quot;/blog/uploads/att397_layout.htm&quot; target=&quot;_blank&quot;&gt;View Sample (new window)&lt;/a&gt;
&lt;p&gt;
&lt;textarea rows=20 cols=50 style=&quot;width:95%&quot;&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
    &lt;title&gt;Untitled Page&lt;/title&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
		function maxContent(){
			var divContent = getElementDimensions(document.getElementById(&quot;content&quot;));
			var divHeader = getElementDimensions(document.getElementById(&quot;header&quot;));
			var divFooter = getElementDimensions(document.getElementById(&quot;footer&quot;));
			var remainder = document.documentElement.clientHeight - divContent.y - divFooter.height - 0
			if(remainder&lt;250){remainder=250}; //minimum height of content
			document.getElementById(&quot;content&quot;).style.height = remainder + &quot;px&quot;;
			function getElementDimensions(q){
				var offsetY=offsetX=0;
				var height=q.scrollHeight;
				var width=q.scrollWidth;
				while(q){
					offsetX+=q.offsetLeft;
					offsetY+=q.offsetTop;
					q=q.offsetParent;
				}
				return{
					&quot;x&quot;:offsetX,&quot;y&quot;:offsetY,&quot;height&quot;:height,&quot;width&quot;:width
				};
			}
		}
		window.onload = maxContent;
		window.onresize = maxContent;
    &lt;/script&gt;
    &lt;style type=&quot;text/css&quot;&gt;
		html,body {
			margin:0;
			padding:0;
		}
		div#container {
		}
		div#header {
			background-color:#fbb;
		}
		div#content {
			background-color:#bfb;
		}
		div#footer {
			background-color:#bbf;
			width:100%;
			bottom:0;
		}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;container&quot;&gt;
		&lt;div id=&quot;header&quot;&gt;
			Header
		&lt;/div&gt;
		&lt;div id=&quot;content&quot;&gt;
			&lt;table border=&quot;1&quot; height=&quot;100%&quot;&gt;
				&lt;tr&gt;
					&lt;td&gt;1&lt;/td&gt;
					&lt;td&gt;2&lt;/td&gt;
					&lt;td&gt;3&lt;/td&gt;
				&lt;/tr&gt;
				&lt;tr&gt;
					&lt;td&gt;b1&lt;/td&gt;
					&lt;td&gt;b2&lt;/td&gt;
					&lt;td&gt;b3&lt;/td&gt;
				&lt;/tr&gt;
			&lt;/table&gt;
		&lt;/div&gt;

		&lt;div id=&quot;footer&quot;&gt;
			Footer
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/textarea&gt;</description>
<comments>http://www.blog.johnavis.com/blog/default.asp?id=397&amp;comments=on#comments</comments>
<pubDate>2008-05-28T12:00:00+10:00</pubDate>
</item>
<item>
<title>Setting a Maximum Page Width Using CSS</title>
<link>http://www.blog.johnavis.com/blog/default.asp?id=348</link>
<description>When designing a web site one of the first decisions to make is whether to use a fixed-width, liquid or other type layout.&lt;br&gt;&lt;br&gt;Fixed-width designs are popular but have certain limitations. If you design for 800x600 your layout may look much too small at a higher resolution. If you design for 1024x768, lower resolution screens will require a horizontal scrollbar.&lt;br&gt;&lt;br&gt;Liquid designs, although not the perfect solution, have less compromises. At very low resolutions they can become very difficult to read and at very high resolutions line lengths can become very long and also difficult to read.&lt;br&gt;&lt;br&gt;A good compromise in my opinion is to use a liquid layout but set a limit to the width.&lt;br&gt;&lt;br&gt;One method of doing this reliably on popular browsers is to use the following styling:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&amp;lt;div style=&quot;max-width:1004px;width:expression(document.body.clientWidth&amp;gt;1004?'1004px':'auto'&quot;&amp;gt;&lt;/pre&gt;In this case, the maximum width is set to 1004 (for 1024x768 screen resolution less 20px for the vertical scroll bar).</description>
<comments>http://www.blog.johnavis.com/blog/default.asp?id=348&amp;comments=on#comments</comments>
<pubDate>2008-02-16T12:00:00+10:00</pubDate>
</item>
</channel>
</rss>
