<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Log &#187; html</title>
	<atom:link href="http://joelpittet.com/log/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://joelpittet.com/log</link>
	<description>Sharing the details</description>
	<lastBuildDate>Thu, 15 Apr 2010 08:22:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to fix browser file caching without a new filename</title>
		<link>http://joelpittet.com/log/2010/04/how-to-fix-browser-file-caching-without-a-new-filename/</link>
		<comments>http://joelpittet.com/log/2010/04/how-to-fix-browser-file-caching-without-a-new-filename/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 08:22:08 +0000</pubDate>
		<dc:creator>Joel Pittet</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[filenames]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://joelpittet.com/log/?p=55</guid>
		<description><![CDATA[Replacing large files on websites can be a pain when the browser caches your files.  Don't change the filename, just append a query string to the end to keep your beautiful filename intact.]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>You have probably run into this problem many times.  Your client gives you a new file to replace the old one.  You say OK, and post the new file and let your client know.  They say it&#8217;s  not changed and you swear it has, you check and it has so you let them know to try again and they and you are suprised that now it works even though you haven&#8217;t made a change.  You realize the browser has cached the old version but you just suck it up and go on with your life till it happens again.  This is very common with large assets like PDF files, Flash files and large images. Also it happens a lot in web applications that replace images.</p>
<h2>Solution</h2>
<p>Put a query string on the file name.  By convention I will have a filename like  specifications.pdf  and I will just put specificaitons.pdf<strong>?v=2</strong> at the end of the href.  It doesn&#8217;t affect the filename when downloaded but does tell the browser that it is a new file.    It&#8217;s much nicer than putting these version or dates into the actual filename unless that is required of you, which keeps the filename nice and simple.</p>
<p>For web applications that change files and display them like an image cropper for example, a great way is to append a datetime on the end of the newly uploaded file.    So that would be filename.jpg<strong>?2010-11-30-11:10:23</strong> or what ever format you prefer. This can be accomplished server or client side, so what ever option you prefer.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelpittet.com/log/2010/04/how-to-fix-browser-file-caching-without-a-new-filename/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing .clearfix with overflow:auto/hidden</title>
		<link>http://joelpittet.com/log/2009/03/replacing-clearfix-with-overflowautohidden/</link>
		<comments>http://joelpittet.com/log/2009/03/replacing-clearfix-with-overflowautohidden/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 07:04:20 +0000</pubDate>
		<dc:creator>Joel Pittet</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[clearfix]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[overflow]]></category>

		<guid isPermaLink="false">http://joelpittet.com/log/?p=45</guid>
		<description><![CDATA[There has been many ways over the years to give the height back to the background of a container around floating elements. First Version This was the first method I spotted years back. This method which left a 1px gap at the end and other unwanted problems. 12345&#60;!-- .clear &#123; &#160; &#160; clear: both; &#125; [...]]]></description>
			<content:encoded><![CDATA[<p>There has been many ways over the years to give the height back to the background of a container around floating elements.</p>
<h3>First Version</h3>
<p>This was the first method I spotted years back. This method which left a 1px gap at the end and other unwanted problems.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!--<br />
.<span style="color: #000000; font-weight: bold;">clear</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
--<span style="color: #00AA00;">&gt;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;container&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;left&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- Left Content --&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;main&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- Right content --&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;clear&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h3>Second version</h3>
<p>The next one replaced the extra HTML for a CSS class which added the content in after the divs through the CSS. The CSS hacks essentially fix all the problems with the above version and some.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!--<br />
<span style="color: #6666ff;">.clearfix</span><span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #00AA00;">;</span> &nbsp;<span style="color: #808080; font-style: italic;">/* Adds content to show the containing box where to end it's rendering */</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Prevents the content from adding any more height to it's parent */</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* keeps this content under the floating elements */</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.clearfix</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #808080; font-style: italic;">/* Hides from IE-mac \*/</span><br />
<span style="color: #00AA00;">*</span> html <span style="color: #6666ff;">.clearfix</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.clearfix</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #808080; font-style: italic;">/* End hide from IE-mac */</span><br />
--<span style="color: #00AA00;">&gt;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;container&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;clearfix&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;left&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- Left Content --&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;main&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- Right content --&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h3>Latest</h3>
<p>This removes most of the hacks. Makes a cleaner CSS and markup and seems to suit me well.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!--<br />
<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* &nbsp;if this element has padding user overflow: hidden; */</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #808080; font-style: italic;">/* IE6 stylesheet needs hasLayout turned on */</span><br />
<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
--<span style="color: #00AA00;">&gt;</span></div></td></tr></tbody></table></div>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;container&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;clearfix&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;left&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- Left Content --&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;main&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- Right content --&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h3>Further information</h3>
<p>Info on hasLayout<br />
<a href="http://www.satzansatz.de/cssd/onhavinglayout.html" target="_blank"> http://www.satzansatz.de/cssd/onhavinglayout.html</a><br />
4 years ago sitepoint posted this:<br />
<a href="http://www.sitepoint.com/blogs/2005/02/26/simple-clearing-of-floats/" target="_blank"> http://www.sitepoint.com/blogs/2005/02/26/simple-clearing-of-floats/</a></p>
<p>If you find one nicer, please let me know in the comments. Or if you have a case where this doesn&#8217;t work. Send me some sample code.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelpittet.com/log/2009/03/replacing-clearfix-with-overflowautohidden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
