<?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>Nerd &#187; nerd</title>
	<atom:link href="http://nerd.vasilis.nl/category/nerd/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerd.vasilis.nl</link>
	<description>Vasilis van Gemert</description>
	<lastBuildDate>Mon, 09 May 2011 07:51:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Prevent iOs from zooming onfocus</title>
		<link>http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/</link>
		<comments>http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/#comments</comments>
		<pubDate>Sun, 08 May 2011 21:00:11 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[ios]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[nerd]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=152</guid>
		<description><![CDATA[When a form element gets focus on iOs the browser zooms in on that element. Very handy in unoptimized layouts where that element might be a few pixels high but annoying and unnecessary in a mobile optimized layout. You can disable this behaviour by changing the meta viewport value onfocus and onblur. Here&#8217;s a simple [...]<p><a href="http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/">Prevent iOs from zooming onfocus</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>When a form element gets focus on iOs the browser zooms in on that element. Very handy in unoptimized layouts where that element might be a few pixels high but annoying and unnecessary in a mobile optimized layout. You can disable this behaviour by changing the meta viewport value onfocus and onblur.<br />
Here&#8217;s a simple jQuery example:</p>
<p><code>$('input, select, textarea').focus(function(){<br />
    $('meta[name=viewport]').attr('content','width=device-width,initial-scale=1,maximum-scale=1.0');<br />
});<br />
$('input, select, textarea').blur(function(){<br />
     $('meta[name=viewport]').attr('content','width=device-width,initial-scale=1,maximum-scale=10');<br />
});</code></p>
<p>Notice the tiny difference between focus and blur: onfocus you set the maximum-scale to 1 and onblur it&#8217;s set to 10. You shouldn&#8217;t use the code above, Wilfred Nas and Mathias Bynens optimized it in the comments to this snippet:</p>
<p><code>var $viewportMeta = $('meta[name="viewport"]');<br />
$('input, select, textarea').bind('focus blur', function(event) {<br />
  $viewportMeta.attr('content', 'width=device-width,initial-scale=1,maximum-scale=' + (event.type == 'blur' ? 10 : 1));<br />
});</code></p>
<p>The browser starts zooming in but immediately zooms out again when the elements gets focus. I like that.</p>
<p><a href="http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/">Prevent iOs from zooming onfocus</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Developer builds</title>
		<link>http://nerd.vasilis.nl/developer-builds/</link>
		<comments>http://nerd.vasilis.nl/developer-builds/#comments</comments>
		<pubDate>Wed, 04 May 2011 18:44:16 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=150</guid>
		<description><![CDATA[All browsers (except for Safari so far) have started to update their browsers more frequently adding more and more new exciting web technologies all the time: a new browser war with mostly winners so far. All these browser vendors are releasing very early versions to the public in order to get as much feedback as [...]<p><a href="http://nerd.vasilis.nl/developer-builds/">Developer builds</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>All browsers (except for Safari so far) have started to update their browsers more frequently adding more and more new exciting web technologies all the time: a new browser war with mostly winners so far. All these browser vendors are releasing very early versions to the public in order to get as much feedback as possible. For my own reference &#8211; and yours too, sure &#8211; here&#8217;s a list of these early versions.</p>
<ul>
<li><a href="http://www.opera.com/browser/next/">Opera Next</a> can be run at the same time as the regular Opera</li>
<li><a href="https://www.mozilla.com/en-US/firefox/channel/">Firefox</a> has an Aurora version (far future, unstable) and a beta version (more stable). You can run them alongside with the help of the <a href="http://www.ghacks.net/2011/01/19/firefox-profile-manager-to-be-removed-soon/">ProfileManager</a></li>
<li><a href="http://tools.google.com/dlpage/chromesxs">Chrome has some Canary Builds</a> which can be run alongside your regular Chrome.</li>
<li>Internet Explorer <a href="http://ie.microsoft.com/testdrive/">Test Drive</a>  versions are released on a regular basis and can run next to IE9 (on Windows 7 only)</li>
</ul>
<p><a href="http://nerd.vasilis.nl/developer-builds/">Developer builds</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/developer-builds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Adaptive CSS Zen Garden</title>
		<link>http://nerd.vasilis.nl/the-adaptive-css-zen-garden/</link>
		<comments>http://nerd.vasilis.nl/the-adaptive-css-zen-garden/#comments</comments>
		<pubDate>Tue, 03 May 2011 20:16:12 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=144</guid>
		<description><![CDATA[In my talks and workshops about responsive web design and adaptive layouts I always take some time to take a look at CSS Zen Garden, since a part of building an adaptive layout is based on the same principle as the Zen Garden has been promoting all these years: the same content can be styled [...]<p><a href="http://nerd.vasilis.nl/the-adaptive-css-zen-garden/">The Adaptive CSS Zen Garden</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://fronteers.nl/blog/2011/04/bijeenkomst-gent">talks</a> and <a href="http://fronteers.nl/cursussen/adaptief-ontwikkelen-vasilis-van-gemert">workshops</a> about responsive web design and adaptive layouts I always take some time to take a look at CSS Zen Garden, since a part of building an adaptive layout is based on the same principle as the Zen Garden has been promoting all these years: the same content can be styled differently by using CSS. I always wanted to make a version of the CSS Zen Garden where a different layout is shown on every different resolution. I never built that thing because it would be way too much work for me, I&#8217;m not a very good coder. </p>
<p>Today I talked about this idea while I was giving a workshop. From that moment on <a href="https://twitter.com/roy">Roy Tomeij</a>, who was attending, was more silent than usual. Ten minutes later he interrupted me with this masterpiece. Ladies and gentleman, I present you the <a href="http://nerd.vasilis.nl/adaptive/zengarden.html">Adaptive CSS Zen Garden</a>. Resize your browser window at your own risk!</p>
<p><a href="http://nerd.vasilis.nl/the-adaptive-css-zen-garden/">The Adaptive CSS Zen Garden</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/the-adaptive-css-zen-garden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another HTML5 fallback strategy for IE</title>
		<link>http://nerd.vasilis.nl/another-html5-fallback-strategy-for-ie/</link>
		<comments>http://nerd.vasilis.nl/another-html5-fallback-strategy-for-ie/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 20:57:34 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[html 5]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=140</guid>
		<description><![CDATA[Versions of Internet Explorer prior to number 9 can not style unknown elements without the help of JavaScript: by adding the unknown elements to the DOM you can style them like any other element. So if you want to use the new HTML5 elements you will need JavaScript to style your site. Most people will [...]<p><a href="http://nerd.vasilis.nl/another-html5-fallback-strategy-for-ie/">Another HTML5 fallback strategy for IE</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Versions of Internet Explorer prior to number 9 can not style unknown elements without the help of JavaScript: by adding the unknown elements to the DOM you can style them like any other element. So if you want to use the new HTML5 elements you will need JavaScript to style your site. Most people will have no problem seeing your site but for those unlucky visitors with IE and JavaScript disabled (for whatever reason, there are lots of them), the experience can be horrible. Here&#8217;s a simple solution:</p>
<p>Serve your default stylesheet to all browsers except IE8 and lower. To those &#8220;browsers&#8221; you serve Andy Clarke&#8217;s <a href="http://code.google.com/p/universal-ie6-css/">universal ie6 css</a> in a conditional comment. Then with the help of a simple javascript you immediately replace this css file with your default css file. Now those unlucky visitors will at least see a nicely styled easy to read minimal site. (View source on <a href="http://vasilis.nl/delicious/">this page</a> to see how it works)</p>
<p>I couldn&#8217;t think of a way to replace the fallback css before it gets loaded so the only negative side effect of this technique is that it uses an extra http request. I think it&#8217;s worth it: for me this JavaScript dependency was the only thing that kept me from using HTML5 elements.</p>
<p><a href="http://nerd.vasilis.nl/another-html5-fallback-strategy-for-ie/">Another HTML5 fallback strategy for IE</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/another-html5-fallback-strategy-for-ie/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Abort an Automator workflow</title>
		<link>http://nerd.vasilis.nl/abort-an-automator-workflow/</link>
		<comments>http://nerd.vasilis.nl/abort-an-automator-workflow/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 21:05:43 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[app]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[nerd]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=88</guid>
		<description><![CDATA[I wanted to abort an OSX Automator workflow if there&#8217;s no internet connection. That function does not exist. It can be done by inserting the action Run Applescript though: try do shell script "curl www.apple.com" on error do shell script "killall name-of-this-script" end try Fill in the name of your Automator application and if there&#8217;s [...]<p><a href="http://nerd.vasilis.nl/abort-an-automator-workflow/">Abort an Automator workflow</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I wanted to abort an OSX <a href="http://www.apple.com/automator/">Automator</a> workflow if there&#8217;s no internet connection. That function does not exist. It can be done by inserting the action Run Applescript though:</p>
<p><code>try<br />
	do shell script "curl www.apple.com"<br />
on error<br />
	do shell script "killall <em>name-of-this-script</em>"<br />
end try</code></p>
<p>Fill in the name of your Automator application and if there&#8217;s an error the script will terminate itself. This way you can build multiple checks. For instance I have another check that stops the automator workflow if a certain disk is not mounted. And suddenly Automator becomes a handy tool. </p>
<p><a href="http://nerd.vasilis.nl/abort-an-automator-workflow/">Abort an Automator workflow</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/abort-an-automator-workflow/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using Twitter feeds to feed your Fever</title>
		<link>http://nerd.vasilis.nl/using-twitter-feeds-to-feed-your-fever/</link>
		<comments>http://nerd.vasilis.nl/using-twitter-feeds-to-feed-your-fever/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 18:47:15 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[app]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[nerd]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=85</guid>
		<description><![CDATA[Shaun Inman redefined the feed reader with his brilliant application Fever. The best thing about it, apart from the brilliant user interface, the beautiful layout, the usability, the feel of a native app, is the fact that you can actually use high volume feeds without reading them. The idea is that a link gets more [...]<p><a href="http://nerd.vasilis.nl/using-twitter-feeds-to-feed-your-fever/">Using Twitter feeds to feed your Fever</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shauninman.com/">Shaun Inman</a> redefined the feed reader with his brilliant application <a href="http://feedafever.com/">Fever</a>. The best thing about it, apart from the brilliant user interface, the beautiful layout, the usability, the feel of a native app, is the fact that you can actually <a href="http://feedafever.com/#demo">use high volume feeds</a> without reading them. The idea is that a link gets more interesting when more feeds link to it. So fever has this section called Heat where all these interesting articles are shown.<br />
<span id="more-85"></span></p>
<p>In order to make this work you need many high volume feeds on the same subject. What better place than Twitter for this purpose? I copypasted/wrote a simple script that finds all URL&#8217;s in a <a href="http://twitter.com/statuses/user_timeline/7694572.rss">twitter feed</a>, follows the 301 or 302 redirects until it gets the 200 header, places this URL in a new feed item.</p>
<p>You&#8217;ll need to install <a href="http://nerd.vasilis.nl/code/twitter-feed-fever.zip">this php script</a> somewhere on a server, optionally change some texts around line number 329 and then add this URL as a spark to Fever:</p>
<p>http://yourdomain.com/dir-of-choice/?feed=http://nerd.vasilis.nl/feed/</p>
<p>You should replace <em>http://nerd.vasilis.nl/feed/</em> with the feed you really want to add.<br />
Now if someone can write a bookmarklet that actually lists all linked feeds in a document and gives you the option to copy them, or directly submit them to fever, I&#8217;d be happy to post it here. </p>
<p><em>Go ahead and laugh at my code, I know it sucks. But let me know how to improve it, I&#8217;m willing to learn.</em></p>
<p><a href="http://nerd.vasilis.nl/using-twitter-feeds-to-feed-your-fever/">Using Twitter feeds to feed your Fever</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/using-twitter-feeds-to-feed-your-fever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display everything</title>
		<link>http://nerd.vasilis.nl/display-everything/</link>
		<comments>http://nerd.vasilis.nl/display-everything/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 18:45:08 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=82</guid>
		<description><![CDATA[I just discovered a nice feature for minimalist frontend developers. You can use all elements with content for styling simply by using * {display:block;} Or display inline, or table-cell or whatever. All elements, including title, style and head can be used for styling now. Have fun with it! (I have only tested this on FF3.5 [...]<p><a href="http://nerd.vasilis.nl/display-everything/">Display everything</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I just discovered a nice feature for minimalist frontend developers. You can use all elements with content for styling simply by using</p>
<p>* {display:block;}</p>
<p>Or display inline, or table-cell or whatever. All elements, including title, style and head can be used for styling now. <a href="http://nerd.vasilis.nl/code/display-everything/">Have fun with it</a>!</p>
<p>(I have only tested this on FF3.5 and Safari. I guess it works on more browsers).</p>
<p><a href="http://nerd.vasilis.nl/display-everything/">Display everything</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/display-everything/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centered images in the middle of a block without (total) loss of usability</title>
		<link>http://nerd.vasilis.nl/centered-images-in-the-middle-of-a-block-without-loss-of-usability/</link>
		<comments>http://nerd.vasilis.nl/centered-images-in-the-middle-of-a-block-without-loss-of-usability/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 20:40:36 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=73</guid>
		<description><![CDATA[The designer wants all images to be centered inside a square box with defined dimensions. The longest side of each image is the same length as this dimension but the smaller side is unknown and variable. Easy you say. &#60;div style=&#8221;background:url(path/to/image-w100xh75.jpg) no-repeat 50% 50%;width:100px;height:100px;&#8221;>&#60;/div> Easy it is. Unless the usability expert comes knocking on your [...]<p><a href="http://nerd.vasilis.nl/centered-images-in-the-middle-of-a-block-without-loss-of-usability/">Centered images in the middle of a block without (total) loss of usability</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The designer wants all images to be centered inside a square box with defined dimensions. The longest side of each image is the same length as this dimension but the smaller side is unknown and variable. Easy you say. </p>
<p>&lt;div style=&#8221;background:url(path/to/image-w100xh75.jpg) no-repeat 50% 50%;width:100px;height:100px;&#8221;>&lt;/div></p>
<p>Easy it is. Unless the usability expert comes knocking on your door. Background images don&#8217;t behave the same as normal images. In most browsers, for instance, you can&#8217;t easily download a background image by right clicking on it. </p>
<p>So you do want the background positioning but you also want some important behaviour of a normal image. Here it is: <a href="http://nerd.vasilis.nl/code/centered-middled-images/index.html">Centered images in the middle of a block with normal usability</a>.</p>
<p>It does not work in fluid or flexible layouts of course. But it does work in all serious browsers and in IE7. Haven&#8217;t tested it in IE6 but there&#8217;s no reason it wouldn&#8217;t work there. I&#8217;m not sure if it creates a performance issue. The images are downloaded only one time, so that&#8217;s not an issue. The only problem might be double memory usage. I haven&#8217;t tested that.</p>
<p><a href="http://nerd.vasilis.nl/centered-images-in-the-middle-of-a-block-without-loss-of-usability/">Centered images in the middle of a block without (total) loss of usability</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/centered-images-in-the-middle-of-a-block-without-loss-of-usability/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Equal height boxes with flexible widths</title>
		<link>http://nerd.vasilis.nl/equal-height-boxes-with-flexible-widths/</link>
		<comments>http://nerd.vasilis.nl/equal-height-boxes-with-flexible-widths/#comments</comments>
		<pubDate>Thu, 14 May 2009 20:52:30 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html 5]]></category>
		<category><![CDATA[nerd]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=66</guid>
		<description><![CDATA[My design buddies @work came up with one of the most complex layouts I ever had to build. You could desribe it as an elastic layout with boxes with a flexible width which should have the same height as it&#8217;s siblings. With rounded corners and dropshadows offcourse. But that would be too easy a description. [...]<p><a href="http://nerd.vasilis.nl/equal-height-boxes-with-flexible-widths/">Equal height boxes with flexible widths</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>My design buddies @work came up with one of the most complex layouts I ever had to build. You could desribe it as an elastic layout with boxes with a flexible width which should have the same height as it&#8217;s siblings. With rounded corners and dropshadows offcourse. But that would be too easy a description. There are templates with 2, 3 and 4 boxes next to each other and these boxes can be contained within containers with different widths. A cynic would ask me why I didn&#8217;t use tables and he would be right. It might have saved me a lot a hassle. But forget about tables.</p>
<p><span id="more-66"></span></p>
<p>One way to build a layout like this is to measure all possible box-sizes to the pixel, create all background-images for these boxes (a few hundred in this extreme case) and start writing a CSS file of a few thousand lines. I chose to see if there&#8217;s another way to do this, with less code and much less images (one). And here I present this other way.</p>
<p>Equal height cols with a flexible width</p>
<p>Basically what this technique comes down to is to place an absolutely positioned div inside a <em>statically positioned floating div</em> which is inside a <em>relatively positioned div</em> with overflow set to auto. The absolutely positioned div can inherit the left position and the width of its direct parent, but if you define its top and its bottom it will, off course, inherit these from the containing, relatively positioned div. And this relatively positioned div will get its height from the highest statically positioned floating div. Why didn&#8217;t you think of this before? (-:</p>
<p>Check out these examples</p>
<ol>
<li><a href="http://nerd.vasilis.nl/code/ehc/equal-height-col-01.html">Equal height cols with a flexible width</a>
<li><a href="http://nerd.vasilis.nl/code/ehc/equal-height-col-02.html">Equal height cols with a flexible width, a border and padding between the boxes</a>
<li><a href="http://nerd.vasilis.nl/code/ehc/equal-height-col-03.html">Equal height cols with a flexible width, padding between the boxes, rounded corners, dropshadows and flexible background-colors</a>
</ol>
<p>IE6 needs JavaScript. I didn&#8217;t bother to include it here. Opera needs an update in order to display this correctly, I filed a bugreport. IE7 has difficulties with percentages.</p>
<p><a href="http://nerd.vasilis.nl/equal-height-boxes-with-flexible-widths/">Equal height boxes with flexible widths</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/equal-height-boxes-with-flexible-widths/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Using position:absolute to avoid inline styles</title>
		<link>http://nerd.vasilis.nl/using-position-absolute-to-avoid-inline-styles/</link>
		<comments>http://nerd.vasilis.nl/using-position-absolute-to-avoid-inline-styles/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 20:25:48 +0000</pubDate>
		<dc:creator>Vasilis</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://nerd.vasilis.nl/?p=38</guid>
		<description><![CDATA[A few weeks ago I upgraded an old Pivot weblog to the latest version of WordPress, a weblog system which is a bit more flexible, I think. One of the things I dislike though is some of the HTML that comes out of it&#8217;s core functions. For example an image with a caption. The known [...]<p><a href="http://nerd.vasilis.nl/using-position-absolute-to-avoid-inline-styles/">Using position:absolute to avoid inline styles</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I upgraded an old Pivot weblog to the latest version of WordPress, a weblog system which is a bit more flexible, I think. One of the things I dislike though is some of the HTML that comes out of it&#8217;s core functions. For example an image with a caption.</p>
<p>The known problem with an image with a caption below it is that it is impossible to make the text as wide as the image without setting the width of the image on the caption.<br />
<span id="more-38"></span></p>
<pre><code>&lt;div class="image-with-caption">
 &lt;img src="image.jpg" alt="">
 &lt;p>This is a caption below an image and the caption ignores the width of the image.&lt;/p>
&lt;/div></code></pre>
<p>The above code will look something like this:</p>
<pre>---------------------------
|                         |
|                         |
|                         |
|                         |
|                         |
|                         |
|                         |
|                         |
---------------------------
This is a caption below an image and the caption ignores the width of the image.</pre>
<p>But we want it to look like this:</p>
<pre>---------------------------
|                         |
|                         |
|                         |
|                         |
|                         |
|                         |
|                         |
|                         |
---------------------------
This is a caption below an
image and the caption  is
as wide as the image.</pre>
<p>This can be done by adding inline styles to the surrounding div (or to the caption itself).</p>
<pre><code>&lt;div class="image-with-caption" width="270px">
 &lt;img src="image.jpg" alt="">
 &lt;p>This is a caption below an image and the caption is as wide as the image.&lt;/p>
&lt;/div></code></pre>
<p>I don&#8217;t like inline styles. So there must be another way to set the width of the caption. Hello position:absolute!</p>
<pre><code>.image-with-caption {
	float: left; /* we want this */
	position: relative; /* we need this */
}

.image-with-caption img {
	display: block; /* we don't need this but it solves things */
}

.image-with-caption p {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0; /* this will make it as wide as the image */
}</code></pre>
<p>The above CSS will render our HTML as follows:</p>
<pre>---------------------------
|                         |
|                         |
|                         |
|                         |
|                         |
|The caption is now placed|
|over the image, aligning |
|at the bottom            |
---------------------------</pre>
<p>You can now decide to only show the caption <a href="http://vasilis.nl/tets/no-width-caption/" title="Or something like that">when hovering over the image</a>. Or you could add a margin below the image of two or three times  the default line-height in order to fit the text below the image. </p>
<p>I know, I know, it is not the same as a flexible caption (flexible in height) below an image, and I sure know it can well result in unreadable and unaccessible text when the caption is very long (or the image is very small). And the photographer won&#8217;t be happy with text over his image and the copywriter won;t like his caption to be hidden. I just don&#8217;t like inline styles. And I love the power of position:absolute</p>
<p>P.S. Yes, I know there is a browser out there called IE6. If you understood what I wrote you can make up a fix. If you didn&#8217;t don&#8217;t use position:absolute.</p>
<p><a href="http://nerd.vasilis.nl/using-position-absolute-to-avoid-inline-styles/">Using position:absolute to avoid inline styles</a> is a post from: <a href="http://nerd.vasilis.nl">Nerd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.vasilis.nl/using-position-absolute-to-avoid-inline-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

