<?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:georss="http://www.georss.org/georss" 
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>bioneural.net &#187; webdev</title>
	<atom:link href="http://www.bioneural.net/tag/webdev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bioneural.net</link>
	<description>bioneural.net is for stuff worth sharing: commentary by Bruce McKenzie. Major topics covered are gadgets, informatics, Internet, Mac, mobile, musings, New Zealand, photography, Project Koru, quicklinks, rant, rave, travel and Windows</description>
	<pubDate>Thu, 08 May 2008 19:36:56 +0000</pubDate>
	
	<language>en</language>
	<image>
		<title>bioneural.net</title>
		<url>http://www.bioneural.net/images/kiwi-yellow-64px.png</url>
		<link>http://www.bioneural.net</link>
		<width>64</width>
		<height>64</height>
		<description>bioneural.net</description>
	</image>
		<item>
		<title>Customizing WordPress feed content</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F13%2Fcustomizing-wordpress-feed-content%2F&amp;seed_title=Customizing+WordPress+feed+content</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F13%2Fcustomizing-wordpress-feed-content%2F&amp;seed_title=Customizing+WordPress+feed+content#comments</comments>
		<pubDate>Sun, 13 Apr 2008 20:38:12 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[microformats]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[rss]]></category>

		<category><![CDATA[tips]]></category>

		<category><![CDATA[webdev]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/?p=920</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>When I last <a href="http://www.bioneural.net/2006/07/20/customizing-feeds-in-wordpress-2x/">looked</a> at customizing feeds in WordPress, it was all to do with being able to offer a summary and full text feed simultaneously&mdash;making use of WordPress' flexible feed URL syntax and a .htaccess file. In this post I look at modifying the actual contents of the feed using a <a href="http://codex.wordpress.org/Theme_Development#Functions_File" rel="external">functions.php</a> file (which may already exist as part of your current theme).<br />
<span id="more-920"></span></p>
<p>Just as WordPress provides a number of hooks for adding or removing actions in your theme header (see <a href="http://www.bioneural.net/2008/01/12/spring-clean-your-wordpress-head/">here</a>), so to do the core files that generate your feeds. Editing the core files is however discouraged (it makes upgrading a pain), and although you can build your own replacement feed templates an easy alternative is adding a few lines to your theme's functions.php file.</p>
<p class="alert">As a perpetual PHP beginner I feel obliged to warn you that use of the following code is at your own risk.</p>
<p>If there are any PHP/ WordPress experts reading this who can improve on my code please make yourself known ;-)</p>
<h4>Removing WP version info</h4>
<p>Somewhere, a while back, I read a tip about not including the WordPress version you are running in your template header&mdash;potentially allowing hackers to identify you as a target if you haven't kept up-to-date. It's easy to remove if present. For example, in the <a href="http://getk2.com/" rel="external">K2</a> theme just delete the following line from header.php:</p>
<pre><code>&lt;meta name="generator" content="WordPress &lt;?php bloginfo('version'); ?&gt;" /&gt;</code></pre>
<p>I recently released that version information was still being sent out in my feed. The feed XML contained a line like this:</p>
<pre><code>&lt;generator&gt;http://wordpress.org/?v=2.x&lt;/generator&gt;</code></pre>
<p>Thanks to Peter Westwood's helpful <a href="http://blog.ftwr.co.uk/archives/2007/10/06/improving-the-wordpress-generator/" rel="external">post</a> I used my theme's functions.php file to remove this with the following code:</p>
<pre><code>//Remove WP version info
function hide_wp_vers() { return ''; }
add_filter('the_generator','hide_wp_vers');</code></pre>
<p>So wherever <code>the_generator</code> function is called (such as in the feed templates in /wp-includes) it gets replaced with... nothing. Job done.</p>
<h4>Adding a feed image</h4>
<p>A feed image (e.g. your site logo or avatar) is an <a href="http://www.rssboard.org/rss-specification#ltimagegtSubelementOfLtchannelgt" rel="external">optional</a> part of the RSS 2.0 spec and shows up in some feed readers along with the feed description. There are plenty of tutorials (search Google) that tell you how to add a feed image by editing core template files, and there are plugins that will add one for you. I had previously edited my core RSS 2.0 template, and lost the changes during upgrades more than once. To avoid this in future here's what's now in my functions.php file:</p>
<pre><code>//Add a feed image
function feed_image() { echo "&lt;image&gt;\n\t\t&lt;title&gt;bioneural.net&lt;/title&gt;\n\t\t&lt;url&gt;http://www.bioneural.net/images/kiwi-yellow-64px.png&lt;/url&gt;\n\t\t&lt;link&gt;http://www.bioneural.net&lt;/link&gt;\n\t\t&lt;width&gt;64&lt;/width&gt;\n\t\t&lt;height&gt;64&lt;/height&gt;\n\t\t&lt;description&gt;bioneural.net&lt;/description&gt;\n\t&lt;/image&gt;\n"; }
add_action('rss2_head', 'feed_image');</code></pre>
<p>Having created my <code>feed_image</code> function I use <code>add_action</code> (<a href="http://codex.wordpress.org/Function_Reference/add_action" rel="external">Codex</a>) to insert my function via the <code>rss2_head</code> hook (<a href="http://codex.wordpress.org/Plugin_API/Action_Reference#Feed_Actions" rel="external">Codex</a>).</p>
<p>Note that <code>\n</code> means new line, <code>\t</code> means tab, and <code>\r</code> (not shown) carriage return: these are just for the sake of formatting. They have no function other than making the feed XML&mdash;which you will likely never see&mdash;look more organized:</p>
<pre><code>&lt;image&gt;
	&lt;title&gt;bioneural.net&lt;/title&gt;
	&lt;url&gt;http://www.bioneural.net/images/kiwi-yellow-64px.png&lt;/url&gt;
	&lt;link&gt;http://www.bioneural.net&lt;/link&gt;
	&lt;width&gt;64&lt;/width&gt;
	&lt;height&gt;64&lt;/height&gt;
	&lt;description&gt;bioneural.net&lt;/description&gt;
&lt;/image&gt;</code>
</pre>
<p>Here's how the above renders when viewed in <a href="http://www.bloglines.com" rel="external">Bloglines</a>:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/04/bloglines.jpg" width="295" height="89" alt="bloglines.jpg" /></p>
<p class="info"><em>Tip</em>: If you want to add a feed image but don't want to do it via a plugin or functions.php, you can use <em>Feed Image Burner</em> from <a href="http://www.feedburner.com" rel="external">FeedBurner</a>.</p>
<h4>Adding a content license</h4>
<p>I've noticed a rise in my content appearing on <a href="http://en.wikipedia.org/wiki/Spam_blog" rel="external">splogs</a>, usually in the form "[Some random name] wrote an interesting post today: here is an excerpt". This violates the <a href="http://creativecommons.org/" rel="external">Creative Commons</a> licensing of my content, which <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="external">requires</a> correct attribution. In a similar vein I've noticed some of my images turning up on "all rights reserved" sites with no attribution. While some folk are no doubt just ignorant, the sploggers are simply morons who don't give a damn. I can't do much about the latter (although I'm giving <a href="http://redalt.com/Resources/Plugins/AntiLeech" rel="external">AntiLeech</a> a spin) but it did get me wondering what I can do to improve the visibility of my licensing terms for the benefit of those "unaware".</p>
<p>The Creative Commons Wiki <a href="http://wiki.creativecommons.org/Syndication" rel="external">links</a> to an RSS 2.0 module for annotating feeds. While this may be machine-parsable I've yet to come across a feed reader that actually picks up on it. As well as incorporating this extension I wanted to add a human-readable annotation to each feed item. This one took a bit of figuring out:</p>
<pre><code>//Add CC license to namespace, item, inline img link within description
function add_license_ns() { echo "\n\t" . 'xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"' . "\n"; }
add_action('rss2_ns', 'add_license_ns');
function add_license_item() { echo "\t" . '&lt;creativeCommons:license&gt;http://creativecommons.org/licenses/by-nc-sa/2.5/&lt;/creativeCommons:license&gt;' . "\n"; }
add_action('rss2_item', 'add_license_item');
function add_license_img($join) {
	$join = _e('&lt;p&gt;&lt;a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"&gt;&lt;img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /&gt;&lt;/a&gt; From &lt;a href="http://www.bioneural.net/about/terms/"&gt;bioneural.net&lt;/a&gt;:&lt;/p&gt;') . the_content();
	return $join;
}
add_filter('the_excerpt_rss','add_license_img');</code></pre>
<p>The first function writes the required namespace declaration; <code>add_action</code> then adds this via the <code>rss2_ns</code> hook (<a href="http://codex.wordpress.org/Plugin_API/Action_Reference#Feed_Actions" rel="external">Codex</a>). The next function/ action pair writes the module to each feed item using rss2_item (<a href="http://codex.wordpress.org/Plugin_API/Action_Reference#Feed_Actions" rel="external">Codex</a>). The third part is the human-readable bit: writing the image, text, and links and concatenating these with <code>the_content()</code> (<a href="http://codex.wordpress.org/Template_Tags/the_content" rel="external">Codex</a>) to replace <code>the_excerpt_rss()</code> (<a href="http://codex.wordpress.org/Template_Tags/the_excerpt_rss" rel="external">Codex</a>). Note also the use of the <a href="http://microformats.org/wiki/rel-license" rel="external">rel-license</a> microformat.</p>
<p class="info">For this to work you must set your <em>Reading Settings</em> in WordPress to <em>Summary</em>, even though we will be displaying the full text (replacing <code>the_excerpt_rss()</code> with <code>the_content()</code>).</p>
<p>The XML will look like this (edited for clarity):</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;rss version="2.0"
	...
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
&gt;

&lt;channel&gt;
	...
		&lt;item&gt;
		&lt;title&gt;Web developer widgets&lt;/title&gt;
		...
		&lt;description&gt;&lt;![CDATA[&lt;p&gt;&lt;a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"&gt;&lt;img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /&gt;&lt;/a&gt; From &lt;a href="http://www.bioneural.net/about/terms/"&gt;bioneural.net&lt;/a&gt;:&lt;/p&gt;&lt;p&gt;Mac-based web developers...&lt;/p&gt;]]&gt;&lt;/description&gt;
		...
		&lt;creativeCommons:license&gt;http://creativecommons.org/licenses/by-nc-sa/2.5/&lt;/creativeCommons:license&gt;
		&lt;/item&gt;</code></pre>
<p>Rendered in a feed reader humans will see this:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/04/reader.jpg" width="295" height="143" alt="reader.jpg" /></p>
<p>The Creative Commons icon is hopefully recognisable and links to the correct license; the link to bioneural.net links to <a href="http://www.bioneural.net/about/terms/">additional</a> terms of use.</p>
<p class="info"><em>Tip</em>: If you prefer not to have full text feeds containing HTML tags, you could use <code>the_content_rss('', '', '', 250)</code> (<a href="http://codex.wordpress.org/Template_Tags/the_content_rss" rel="external">Codex</a>) in place of <code>the_content()</code> to produce a 250 word text-only teaser.</p>
<h4>Expanding the feed description</h4>
<p>The text of the feed description is ordinarily the same text that appears as the tagline for your blog (set in <em>General Settings</em>). You might want to keep it short in your blog header, but perhaps send a more informative version out with your feed. </p>
<p>In K2 at least the description is only used in the head:</p>
<pre><code>&lt;meta name="description" content="&lt;?php bloginfo('description'); ?&gt;" /&gt;</code></pre>
<p>and header:</p>
<pre><code>&lt;p class="description"&gt;&lt;?php bloginfo('description'); ?&gt;&lt;/p&gt;</code></pre>
<p>One solution is therefore to replace the PHP call with short fixed text descriptions (e.g. "stuff worth sharing") in your theme template (header.php) and make the description/ tagline in WP <em>General Settings</em> longer, so it gets into your feed e.g.:</p>
<pre><code>&lt;description&gt;bioneural.net is for stuff worth sharing: commentary by Bruce McKenzie. Major topics covered are gadgets, informatics, Internet, Mac, mobile, musings, New Zealand, photography, Project Koru, quicklinks, rant, rave, travel and Windows&lt;/description&gt;</code></pre>
<p>I was unable to successfully utilize <code>rss2_head</code> (<a href="http://codex.wordpress.org/Plugin_API/Action_Reference#Feed_Actions" rel="external">Codex</a>) in a way that avoided duplicate descriptions.</p>
<p class="info"><em>Tip</em>: Another way to add a more detailed description to your feed only is to use <em>Title/Description Burner</em> from <a href="http://www.feedburner.com" rel="external">FeedBurner</a>.</p>
<h4>Adding a category image</h4>
<p>I previously used the now neglected <a href="http://coffee2code.com/archives/2004/06/27/plugin-category-images/" rel="external">Category Image(s)</a> plugin to send out a category icon with each feed item, replicating their use on my blog to readily identify Mac-related posts, etc. All I needed to do was replace the default item description with this:</p>
<pre><code>&lt;description&gt;&lt;![CDATA[&lt;?php c2c_the_category_image(); ?&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php the_excerpt_rss() ?&gt;]]&gt;&lt;/description&gt;</code></pre>
<p>Sadly such a trick doesn't work with the <a href="http://wordpress.org/extend/plugins/category-icons/" rel="external">Category Icons</a> plugin I am now using, but I've been in touch with the plugin author and submitted this as a feature request.</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F13%2Fcustomizing-wordpress-feed-content%2F&amp;seed_title=Customizing+WordPress+feed+content/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>Web developer widgets</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F11%2Fweb-developer-widgets%2F&amp;seed_title=Web+developer+widgets</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F11%2Fweb-developer-widgets%2F&amp;seed_title=Web+developer+widgets#comments</comments>
		<pubDate>Fri, 11 Apr 2008 21:42:29 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Quicklinks]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[Mac]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/?p=917</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>Mac-based web developers may yet find a use for Dashboard. <a href="http://www.apple.com/downloads/dashboard/reference/seess.html" rel="external">SeeSS</a> is a CSS property reference detailing inheritance, CSS compliance, Safari support, possible and default values, examples, plus an informative description [<a href="http://www.bioneural.net/wp-content/uploads/2008/04/seess.jpg" rel="ibox">screenshot</a>]. <a href="http://www.apple.com/downloads/dashboard/developer/phpfunctionreference.html" rel="external">PHP Function Reference</a> provides offline access to the PHP manual, a cheat sheet, and an interactive date formatter [<a href="http://www.bioneural.net/wp-content/uploads/2008/04/phpfr.jpg" rel="ibox">screenshot</a>].</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F11%2Fweb-developer-widgets%2F&amp;seed_title=Web+developer+widgets/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>RDF v microformats v meta headers</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F05%2Frdf-v-microformats-v-meta-headers%2F&amp;seed_title=RDF+v+microformats+v+meta+headers</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F05%2Frdf-v-microformats-v-meta-headers%2F&amp;seed_title=RDF+v+microformats+v+meta+headers#comments</comments>
		<pubDate>Sat, 05 Apr 2008 18:24:49 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Quicklinks]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[metadata]]></category>

		<category><![CDATA[microformats]]></category>

		<category><![CDATA[webdev]]></category>

		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/?p=895</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>I've had a hard time "getting" <a href="http://www.w3.org/RDF/" rel="external">RDF</a> (e.g. how it <a href="http://www.w3.org/DesignIssues/RDF-XML.html" rel="external">differs</a> from XML), but this <a href="http://www.readwriteweb.com/archives/semantic_web_patterns.php" rel="external">article</a> helps give it context. The semantic web is being built simultaneously from the bottom up and top down. Typifying the bottom-up approach, RDF content is machine-readable at the outset; powerful but complex (with several <a href="http://www.semanticfocus.com/blog/entry/title/microformats-vs-rdf-how-microformats-relate-to-the-semantic-web/" rel="external">advantages</a> over microformats), RDF is all about inter-operability. Top-down approaches introduce "<a href="http://www.semanticfocus.com/blog/entry/title/moving-towards-the-semantic-web-grassroots-vs-ivory-towers/" rel="external">metadata sprinkling</a>" to existing content, simple but limiting by comparison e.g. <a href="http://microformats.org/" rel="external">microformats</a> (using CSS class attributes as in <a href="http://www.bioneural.net/2007/08/17/implementing-the-hcard-microformat/">hCard</a>), or <a href="http://en.wikipedia.org/wiki/Meta_element" rel="external">meta elements</a> (meta tags such as those for <a href="http://www.bioneural.net/2008/03/09/mapping-fun-with-georss-and-geo-discovery/">geo-discovery</a>). Both approaches are <a href="http://www.readwriteweb.com/archives/semantic_web_patterns.php" rel="external">valid</a>, but RDF is hard whereas microformats help "the rest of us" contribute to the semantic web. There may be a <a href="http://evan.prodromou.name/RDFa_vs_microformats" rel="external">collision</a> ahead, however, between microformats and <a href="http://www.w3.org/TR/xhtml-rdfa-primer/" rel="external">RDFa</a> (sprinklings of RDF embedded in existing XHTML).</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F04%2F05%2Frdf-v-microformats-v-meta-headers%2F&amp;seed_title=RDF+v+microformats+v+meta+headers/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>Clinical knowledge architect for hire</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F19%2Fclinical-knowledge-architect-for-hire%2F&amp;seed_title=Clinical+knowledge+architect+for+hire</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F19%2Fclinical-knowledge-architect-for-hire%2F&amp;seed_title=Clinical+knowledge+architect+for+hire#comments</comments>
		<pubDate>Wed, 19 Mar 2008 08:34:04 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Informatics]]></category>

		<category><![CDATA[intranet]]></category>

		<category><![CDATA[medicine]]></category>

		<category><![CDATA[nhs]]></category>

		<category><![CDATA[webdev]]></category>

		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/2008/03/19/clinical-knowledge-architect-for-hire/</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>Dr <a href="javascript:void(location.href='http://feeds.technorati.com/contacts/'+escape(location.href))" title="Download vCard for Bruce McKenzie (requires JavaScript)">Bruce McKenzie</a> is now available for freelance consultancy as a clinical knowledge architect, addressing the unmet need for usable knowledge resources at the point-of-care in UK general practice. General practitioners (GPs) make more decisions in a day than a typical business executive, and these decisions cost not just money but potentially lives. It's challenging work, and you can but hope your decisions are based on good information. The problem is information overload and access to what you need when you need it: there's just too much and it's too hard to find in the context of a 10 minute consultation. As a GP for 10 years I can relate to this. I also have informatics knowledge and experience, and this puts me in a position to offer you solutions that are built the way a doctor would design them.<br />
<span id="more-870"></span></p>
<p>The fact is information doesn't become knowledge by itself. After careful needs assessment raw information must be broken down and reconstructed into a usable form as part of a design process that draws upon both the art and science of information architecture. In other words it's a creative process, but it also necessitates solid technical insight into the context in which a knowledge resource will be used.</p>
<p>With my primary care background, grasp of medical informatics, passion for writing, and practical experience in delivering concise clinical guidance for use at the point-of-care, I am now available for freelance consultancy as a clinical knowledge architect.</p>
<h4>Experience in primary care</h4>
<p>Ten years experience in several general practices in the UK and New Zealand has given me a practical understanding of the breadth and depth of primary care, and the opportunity to utilize a variety of decision-support tools. A healthy mix of team working and self-directed activity has afforded me insights into group dynamics without compromising my ability to work as an independent professional. An advocate for evidence-based practice, my most recent NHS position included a contracted weekly session on quality initiatives (including on the Quality &amp; Outcomes Framework and RCGP Quality Practice Award preparation). As a nominated GP representative to the Priorities and Clinical Effectiveness Forum (PACEF) in North Derbyshire I shared my passionate views concerning the appropriate form of information destined for use at the point-of-care, instigating "bottom line" summaries in GP circulars and promoting quick-reference guideline flow charts supported by textual background (rather than the opposite).</p>
<h4>Experience in medical informatics</h4>
<p>As a web developer since 1994 I have a good understanding of evolving technologies used in the delivery of online content, appreciating their potential and recognizing their limitations. While the Diploma in Medical Informatics provides confirmation of my theoretical knowledge, I have considerable real-world experience in clinical knowledge architecture and in supporting practice intranets (2001&ndash;2006). As both an online information provider and consumer I understand that print and online media are not the same and that treating them as such can lessen the impact of your content. In the context of a consultation "less is more" when it comes to effective decision support.</p>
<blockquote><p>
What if you could adhere to national and local guidelines, stick to your prescribing and clinical formularies, ensure you do what counts for QOF, and indicate who is responsible for doing what? What if you could distil all these requirements into a single screen on your computer?
</p></blockquote>
<p>A particular interest, first realized in 2002, is the adaptation of evidence-based guidelines for use during the consultation. Much of the guidance available to primary care clinicians still comprises large amounts of textual information and suffers from poor accessibility as a result. During 2004&ndash;2006 part of my self-imposed remit was to distill and homogenize competing guidelines (NICE, NSF, PCT, etc.) into consultation-optimized flow charts, to integrate these with clinical terms and prescribing formularies, to take account of in-house resources and indicate areas of clinical responsibility, to ensure concordance with local secondary care clinical practices, to address quality indicators in the New GMS Contract, and to publish the result on a practice intranet as cross-referenced clickable image maps. This was no small task but completed for all the QOF clinical indicators; my ultimate vision was full clinical system integration (using XML for data exchange). </p>
<h4>Experience in technical writing</h4>
<p>Being first to the market in 1995 with the paperback <em>Medicine and the Internet</em> demonstrated my commitment and dedication to meeting deadlines (from proposal to shelf within 12 months is highly unusual for a medical textbook). I delivered two subsequent editions of this commercially successful title, further refining my literary abilities to Oxford standards and, in the third edition, my editorial skills. I continue writing for pleasure, often on technical subjects, via my weblog.</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/03/design.jpg" width="450" height="338" alt="design.jpg" /><br /><span class="caption">Creating knowledge from information needs an architect [&copy; iStockPhoto]</span></p>
<h4>What makes my service unique?</h4>
<p>The combination of cross-domain knowledge and experience described above is itself a rarity. Furthermore, being independent yet able to work with the NHS gives me the clinical insight and technical flexibility to help you beyond the limitations of a "one size fits all" NHS informatics service. I don't have to deliver an "out of the box" solution and try to convince you that's what you need: you tell me what you want and I'll work with you to design it.</p>
<p>For more information, please go <a href="http://www.bioneural.net/hire">here</a>.</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F19%2Fclinical-knowledge-architect-for-hire%2F&amp;seed_title=Clinical+knowledge+architect+for+hire/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>Microsoft Silverlight takes on Flash</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F13%2Fmicrosoft-silverlight-takes-on-flash%2F&amp;seed_title=Microsoft+Silverlight+takes+on+Flash</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F13%2Fmicrosoft-silverlight-takes-on-flash%2F&amp;seed_title=Microsoft+Silverlight+takes+on+Flash#comments</comments>
		<pubDate>Thu, 13 Mar 2008 09:41:16 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Quicklinks]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/2008/03/13/microsoft-silverlight-takes-on-flash/</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>Microsoft <a href="http://www.microsoft.com/silverlight/" rel="external">Silverlight</a> is a proprietary cross-browser, almost cross-platform (not <a href="http://en.wikipedia.org/wiki/Moonlight_%28runtime%29" rel="external">yet</a> Linux), and cross-device (WM6 &amp; Symbian only) plug-in vaguely tasked with "delivering the next generation of <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="external">.NET</a> based media experiences and rich interactive applications for the Web." The developer tools (Windows or Mac) output interactive text, bitmap images, vector graphics, animations, and video (<a href="http://en.wikipedia.org/wiki/Windows_Media_Video" rel="external">WMV</a>)/ audio (<a href="http://en.wikipedia.org/wiki/Windows_Media_Audio" rel="external">WMA</a> and <a href="http://en.wikipedia.org/wiki/MP3" rel="external">MP3</a>) playback, in competition primarily with <a href="http://en.wikipedia.org/wiki/Adobe_Flash" rel="external">Flash</a>. The plug-in is free (v2 is currently in <a href="http://www.microsoft.com/silverlight/resources/installationFiles.aspx?v=2.0" rel="external">beta</a>) &amp; curiously you can <a href="http://silverlight.net/learn/learnvideo.aspx?video=209" rel="external">download</a> the <em>Getting started</em> video in QuickTime for iPod! More <a href="http://en.wikipedia.org/wiki/Microsoft_Silverlight" rel="external">here</a>.</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F13%2Fmicrosoft-silverlight-takes-on-flash%2F&amp;seed_title=Microsoft+Silverlight+takes+on+Flash/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>iBox now at version 2</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F12%2Fibox-now-at-version-2%2F&amp;seed_title=iBox+now+at+version+2</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F12%2Fibox-now-at-version-2%2F&amp;seed_title=iBox+now+at+version+2#comments</comments>
		<pubDate>Wed, 12 Mar 2008 19:02:21 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Quicklinks]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[webdev]]></category>

		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/2008/03/12/ibox-now-at-version-2/</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>A customised version of <a href="http://gamma.ibegin.com/ibox/" rel="external">iBox</a> is used extensively on bioneural.net (e.g. the Flickr photocast <a href="http://www.bioneural.net/extra/">here</a>) and <a href="http://www.ibegin.com/" rel="external">iBegin</a> have just released version 2. This free JavaScript lets you display automatically scaling images, external documents, or embedded containers in an overlay dialog without needing to reload the page. iBox has gained some weight since v1.2.1 (2006) but remains compact compared to other Lightbox-alike solutions and just as simple to use, now boasting wider browser support and new plug-in capabilities (e.g. for embedding <a href="http://www.youtube.com/" rel="external">YouTube</a> videos). In most cases it degrades gracefully when JavaScript is disabled (it won't display hidden inline containers; JavaScript is required to play YouTube videos).</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F03%2F12%2Fibox-now-at-version-2%2F&amp;seed_title=iBox+now+at+version+2/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>A web standard icon for geotagging</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F21%2Fa-web-standard-icon-for-geotagging%2F&amp;seed_title=A+web+standard+icon+for+geotagging</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F21%2Fa-web-standard-icon-for-geotagging%2F&amp;seed_title=A+web+standard+icon+for+geotagging#comments</comments>
		<pubDate>Thu, 21 Feb 2008 13:35:39 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[geotagging]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[gps]]></category>

		<category><![CDATA[icons]]></category>

		<category><![CDATA[metadata]]></category>

		<category><![CDATA[microformats]]></category>

		<category><![CDATA[omnigraffle]]></category>

		<category><![CDATA[opml]]></category>

		<category><![CDATA[rss]]></category>

		<category><![CDATA[Travel]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/2008/02/21/a-web-standard-icon-for-geotagging/</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p><a href="http://en.wikipedia.org/wiki/Geotagging" rel="external">Geotagging</a> (or <a href="http://en.wikipedia.org/wiki/Geocoding" rel="external">geocoding</a> if you prefer) is the act of associating your content (blog posts, photos, feeds, etc.) with a geographic location (e.g. via latitude and longitude co-ordinates). Thus tagged authors can "mash" their content together with the likes of <a href="http://maps.google.com/" rel="external">Google Maps</a>, or the <a href="http://www.flickr.com/map/" rel="external">Flickr Map</a> if photography is your thing. However, co-ordinates are typically encoded within <a href="http://en.wikipedia.org/wiki/ICBM_address" rel="external">metadata</a> (or <a href="http://microformats.org/wiki/geo" rel="external">microformat</a>) tags making them visible to machines but <a href="http://www.bioneural.net/wp-content/uploads/2008/02/flickr-geotag.jpg" rel="ibox">hidden</a> from people. We have de facto web standard icons to help identify <a href="http://www.feedicons.com/" rel="external">feeds</a>, <a href="http://www.opmlicons.com/" rel="external">OPML</a>, and <a href="http://www.openshareicons.com/" rel="external">sharing</a>&mdash;so why not for geotagged content?<br />
<span id="more-842"></span></p>
<p class="alert"><strong>Update 29.02.08</strong>: Thanks to everyone who gave feedback or otherwise contributed to the process of taking this proposal forward. Comments are now closed and further feedback should now be directed to <a href="http://www.geotagicons.com">geotagicons.com</a>, where you can now download the new community-designed geotag icon.</p>
<h4>The goods</h4>
<p>I propose a web standard Geotag Icon, to be used freely by any geotagger or geotagging service. Here is what it looks like at 128px:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/geotag-128px.jpg" width="128" height="128" alt="geotag-128px.jpg" /></p>
<p>At 32px:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/geotag-32px.jpg" width="32" height="32" alt="geotag-32px.jpg" /></p>
<p>And at 16px:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/geotag-16px.jpg" width="16" height="16" alt="geotag-16px.jpg" /></p>
<p class="info"><strong>Important</strong>: <em>These images are not final; this is a proposal</em>. Please do not <a href="http://en.wikipedia.org/wiki/Inline_linking" rel="external">hotlink</a> to these images. You can download them individually by right-clicking the one you want, or as part of the draft Geotag Icon Development Kit <a href="http://www.bioneural.net/extra/">here</a>.</p>
<h4>Family line-up</h4>
<p>The family resemblance is obvious:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/set.jpg" width="450" height="103" alt="set.jpg" /></p>
<p class="info">Why not complete the set? Grab the <a href="http://www.feedicons.com/" rel="external">Feed</a> icon, the <a href="http://www.opmlicons.com/" rel="external">OPML</a> icon, and the <a href="http://www.openshareicons.com/" rel="external">Open Share</a> icon.</p>
<p><em>Update 27.03.08</em>: The <a href="http://www.openshareicons.com/" rel="external">Open Share Icon Project</a> offers a free, open, community-driven alternative to the trademarked and brand-linked <a href="http://sharethis.com/" rel="external">ShareThis.com</a> icon.</p>
<h4>Icon specification</h4>
<ul>
<li>It should be similar in style to existing de facto web standard icons (hereafter known as "the Three");</li>
<li>It should be distinctive in colour from the Three;</li>
<li>The colour should in some way represent it's purpose (although this is not a feature of the Three);</li>
<li>It has to be recognizable at 16px yet not look dull at larger sizes;</li>
<li>It should be format-agnostic (it doesn't matter what geotagging method is used);</li>
<li>It should not be closely aligned with iconography from an existing service (e.g. people shouldn't say "Ah, that's the default Google Maps marker!"). That is, it should be service-agnostic.</li>
</ul>
<h4>Inspirations</h4>
<p>Words or objects you might associate with geotagging abound. For example, map, compass, navigation, co-ordinates, gridlines, waypoints, pins, markers, X marks the spot, GPS satellites, etc. A Google Image search turns up some rather beautiful yet overly detailed (for our purposes) icon examples, such as <a href="http://www.caffeinatedcocoa.com/magrathea/index.html" rel="external">Magrathea</a>, <a href="http://www.geoxtract.com/" rel="external">geoXtract</a>, <a href="http://www.routebuddy.com/routebuddy/index.html" rel="external">RouteBuddy</a>, and <a href="http://www.houdah.com/houdahGeo/index.html" rel="external">HoudahGeo</a>. Some are less delicate (e.g. the button used by the <a href="http://microformats.org/wiki/geo" rel="external">geo</a> microformat or the <a href="http://www.geocaching.com/" rel="external">Geocaching.com</a> logo) but closer to the simplicity we are looking for.</p>
<p>The visual essence of geotagging is marking a point with a pointed object (physical or virtual). In the days before the Internet when I dreamed of travelling the world I had a National Geographic world map on my wall into which I placed pins or tacks to indicate places I'd like to visit. I dug around in my wife's stationery draw and found a few examples:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/3pins.jpg" width="141" height="115" alt="3pins.jpg" /></p>
<p>I think we can all relate to the middle one; it's user-friendly, iconic, and best of all it doesn't get stuck into your heel as easily as the drawing pin when scattered on the floor!</p>
<h4>Anatomy of an icon</h4>
<p>It might not be an obvious choice, but lacking <a href="http://www.adobe.com/products/illustrator/" rel="external">Illustrator</a> or the skills to use it, I often use <a href="http://www.omnigroup.com/applications/omnigraffle/" rel="external">OmniGraffle</a> as a drawing tool. The interface is world-class and it can export to a number of formats, including PDF, giving me the option to supply a vector version. Here is the recipe I used if you want to bake your own version, or try out a variation of your own design:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/anatomy.jpg" width="378" height="129" alt="anatomy.jpg" /></p>
<p>The tack itself is white (with no stroke) to match the central elements of the Three (and it so happens that my model pin was white!). As you increase size, greater detail becomes visible. Crucially the detail degrades gracefully at smaller sizes (16px and 32px shown magnified):</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/detail.jpg" width="343" height="257" alt="detail.jpg" /></p>
<p>Brown is an oft maligned colour although&mdash;as <a href="http://david-hall.net" rel="external">David</a> observed&mdash;a tinge of bronze prevents it looking too "dirty". Brown of course is the colour of earth&mdash;unless you live in Australia's <a href="http://www.bioneural.net/map/?lat=-23.700358&amp;lng=133.880889">Red Centre</a>. If you do hail from the Land of Oz don't panic, as the devkit allows you to change the tone (e.g. a red dust effect!) in Photoshop. See the included readme.pdf for details.</p>
<h4>Usage examples</h4>
<p>It's up to you how you use it, but bear in mind it's not intended as a marker replacement (markers with points are generally more appropriate for that). The idea is to add a visual identifier to your content (blog post, photo, etc.) indicating associated geodata. The image doesn't have to link anywhere, but hyperlinks should be used if it makes sense to do so.</p>
<p>For example, I'm using the <a href="http://code.google.com/p/wordpress-geo-mashup/" rel="external">Geo Mashup</a> plugin for <a href="http://www.wordpress.org" rel="external">WordPress</a> and display it in several locations. It appears as an overlay on category images (itself a <a href="http://www.coffee2code.com/wp-plugins/" rel="external">plugin</a>) that have associated geodata, so you know at a glance that the post pertains to a particular location:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/cat-image.jpg" width="341" height="193" alt="cat-image.jpg" /></p>
<p>Clicking on the icon transports you to that location on my Google Map (see my <a href="http://www.bioneural.net/category/travel/">Travel</a> category for live examples). The relevant template code is:</p>
<pre><code>&lt;div class="catimage"&gt;
	&lt;?php c2c_the_category_image(); ?&gt;
	&lt;?php $coordinates = GeoMashup::post_coordinates(); if ($coordinates) { echo '&lt;span class="geotag-overlay"&gt;'; GeoMashup::show_on_map_link('&lt;img src="../geotag-16px.png" alt="geotag" /&gt;'); echo '&lt;/span&gt;'; } ?&gt;
&lt;/div&gt;</code></pre>
<p>The class <code>.geotag-overlay</code> is styled in CSS with:</p>
<pre><code>.geotag-overlay { width: 16px; height: 16px; position: absolute; margin-top: 16px; margin-left: -16px; }</code></pre>
<p>The Geotag Icon also appears in the actions box at the foot of an entry, adjacent to the coded co-ordinates and direct link to the location on my Google <a href="http://www.bioneural.net/map/">Map</a>:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/footer.jpg" width="375" height="146" alt="footer.jpg" /></p>
<p>The relevant template code is:</p>
<pre><code>&lt;?php $coordinates = GeoMashup::post_coordinates(); if ($coordinates) { echo '&lt;span class="geotag"&gt;Geotagged at lat ' . $coordinates['lat'] . ', lng ' . $coordinates['lng'] . ' ('; GeoMashup::show_on_map_link('View'); echo ' on map)&lt;/span&gt;'; } ?&gt;</code></pre>
<p>The CSS for such inline use is:</p>
<pre><code>.geotag { padding: 2px 0 2px 20px; background: url('geotag-16px.png') left center no-repeat; }</code></pre>
<p>Finally, it appears in the info window when you click on a map marker next to the post title:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/info-window.jpg" width="257" height="305" alt="info-window.jpg" /></p>
<p>This is done is CSS only, like so (<code>.locationinfo</code> is a styling hook provided by the Geo Mashup plugin):</p>
<pre><code>.locationinfo h2 { font-size: 1.2em; font-weight: bold; background: url('geotag-16px.png') left center no-repeat; text-align: left; padding: 2px 0 2px 20px !important; }</code></pre>
<h4>Credits</h4>
<p>Thanks to <a href="http://david-hall.net" rel="external">David</a> for getting me <a href="http://david-hall.net/map-inspecting" rel="external">interested</a> in geotagging again, and for early feedback on the proposed icon. <a href="http://mattbrett.com" rel="external">Matt Brett</a>, <a href="http://www.krossi.com/" rel="external">Ken Rossi</a>, and <a href="http://alexking.org/" rel="external">Alex King</a> are responsible for promoting the Three.</p>
<h4>Your opinion counts</h4>
<p>I am not opposed to change, colour or otherwise, if that is what folk ask for. My interest is in helping the semantic web become more visible to people, and the proposal is here to stimulate discussion and hopefully arrive at some form of consensus (to the extent that is possible on the Internet!).</p>
<p class="info">If you have an opinion, please share it <a href="http://www.bioneural.net/2008/02/21/a-web-standard-icon-for-geotagging/#comments">here</a> or participate in the <a href="http://www.flickr.com/groups/flickrideas/discuss/72157603958525666/" rel="external">discussion</a> on Flickr.</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F21%2Fa-web-standard-icon-for-geotagging%2F&amp;seed_title=A+web+standard+icon+for+geotagging/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>How to safely inject CSS3 using jQuery</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F14%2Fhow-to-safely-inject-css3-using-jquery%2F&amp;seed_title=How+to+safely+inject+CSS3+using+jQuery</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F14%2Fhow-to-safely-inject-css3-using-jquery%2F&amp;seed_title=How+to+safely+inject+CSS3+using+jQuery#comments</comments>
		<pubDate>Thu, 14 Feb 2008 14:14:56 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/2008/02/14/how-to-safely-inject-css3-using-jquery/</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>So you fancy using some of that &uuml;ber-cool draft CSS3 that <a href="http://webkit.org/" rel="external">WebKit</a> browsers can handle, such as text shadows, drop shadows, opacity and rounded corners? But at the same time you want to present only valid CSS to the W3C CSS <a href="http://jigsaw.w3.org/css-validator/" rel="external">Validator</a>? It's a dilemma, but it is possible to have your cake and eat it too&mdash;albeit by hiding CSS in JavaScript and thus cheating the Validator. However, there is even a precedent for doing so.<br />
<span id="more-829"></span></p>
<p>During the course of researching my review of the <a href="http://www.bioneural.net/2008/02/06/the-best-way-to-do-corners-and-gradients/">various</a> <a href="http://www.bioneural.net/2008/02/13/corners-gradients-and-shadows-with-jquery/">ways</a> to make rounded corners, drop shadows, and gradients I learned more about <a href="http://www.w3.org/TR/css3-roadmap/" rel="external">CSS3</a> and the <a href="http://jquery.com/" rel="external">jQuery</a> JavaScript library. They just needed introducing to one another.</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/effects.jpg" width="450" height="376" alt="effects.jpg"/><br /><span class="caption">Text shadows, drop shadows, and round corners in Safari 3</span></p>
<h4>A historical precedent</h4>
<p>The concept of tricking the Validator to pass CSS that is incorrectly implemented or proprietary and not part of the W3C spec is not new. Many web developers have found it necessary to employ various hacks in their CSS to accommodate differences in the way browsers interpret the rules. Others have used proprietary code to overcome limitations or quirks in the way some browsers handle certain content. For example, the following in your document head could be used to fix IE6's lack of handling for transparent PNGs and mis-handling of the box model, floats, overflow, <a href="http://www.bioneural.net/2008/02/01/ie6-italics-and-overflow-issues/">italics</a>, etc.:</p>
<pre><code>&lt;!--[if lte IE 6]&gt;
	&lt;style type="text/css"&gt;
	#pnglogo {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='../logo-trans.png'); padding-top: 57px; }
	&lt;/style&gt;
	&lt;link rel="stylesheet" type="text/css" media="screen" href="../ie6-patches.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<p>It's a hack: there's no other term for it. In the above example we're using proprietary conditional comments and filters to fix proprietary cock-ups. Seems fair, doesn't it?</p>
<p>So, if we can hack our way to supporting inferior or out-dated browsers, why should we not also employ hacks to support leading-edge browsers like Safari 3 that are already capable of rendering much of that draft CSS3 goodness? </p>
<h4>Using jQuery's CSS injector</h4>
<p>There are probably multiple JavaScripts that let you load CSS via the <a href="http://www.w3.org/DOM/" rel="external">DOM</a>, but since I'm using jQuery anyway that's how I've chosen to do it. If you don't have jQuery installed go <a href="http://docs.jquery.com/Downloading_jQuery" rel="external">get</a> it and load it in your document head e.g.:</p>
<pre><code>&lt;script type="text/javascript" src="../jquery-1.2.3.pack.js"&gt;&lt;/script&gt;</code></pre>
<p>Below this we create a <code>$(document).ready()</code> <a href="http://docs.jquery.com/Events/ready#fn" rel="external">function</a> so that the contents load via the DOM and hopefully before the page content is displayed. Inside this function our "content" consists of a series of CSS <a href="http://docs.jquery.com/Selectors" rel="external">selectors</a> (inside the first bracket) paired with the CSS properties we wish to inject (name and value, comma-separated) joined via <a href="http://docs.jquery.com/CSS/css#namevalue" rel="external">.css</a>. Example:</p>
<pre><code>&lt;!-- Have jQuery inject WebKit CSS via DOM on selected elements --&gt;
&lt;script type="text/javascript"&gt;
	$(document).ready(function(){
	$("h1").css("text-shadow","black 0.2em 0.3em 0.2em");
	$(".description").css("text-shadow","black 0.2em 0.3em 0.2em");
	$("#page").css("-webkit-box-shadow","#333 0px 5px 10px");
	$("#footer").css("-webkit-box-shadow","#333 0px 5px 10px");
	$(".container").css("-webkit-box-shadow","#333 0px 5px 10px");
	$(".container").css("-webkit-border-radius","10px");
});
&lt;/script&gt;</code></pre>
<p>If you had a div with the class "container koru", for <a href="http://www.bioneural.net/category/project-koru/">example</a>, Safari 3 will blend the above box-shadow and border-radius styling (as inline CSS3) with any additional CSS2.1 styling for .container or .koru present in your stylesheet. You can see what's going on using that browser's <a href="http://webkit.org/blog/122/webkit-3-10-new-things/" rel="external">Web Inspector</a>:</p>
<p><img src='http://www.bioneural.net/wp-content/uploads/2008/02/s3-inspector.jpg' alt='web-inspector' /></p>
<p class="info"><em>Note</em>: A -webkit- or -moz- prefix on CSS properties is used respectively by the Safari and Mozilla/Firefox browsers to indicate tentative support for as yet non-ratified web standards. Thus <code>-webkit-border-radius: 10px;</code> and <code>-moz-border-radius: 10px;</code> are both potentially differing implementations of "<a href="http://www.w3.org/TR/2005/WD-css3-background-20050216/#the-border-radius" rel="external">border-radius</a>".</p>
<p>OK, so the "how" is easy. Now the "Should you?"</p>
<h4>The positives</h4>
<p class="for">Effects are rendered without requiring images.</p>
<p class="for">Effects are rendered without requiring add-on JavaScript effects libraries.</p>
<p class="for">Effects are rendered without increasing page size or load time.</p>
<p class="for">Effects are rendered that may be impossible with some JavaScript or image-based techniques (e.g. anti-aliasing, liquid layout support).</p>
<p class="for">Effects can be targeted at specific web browser engines.</p>
<p class="for">No changes to semantic mark-up are required.</p>
<p class="for">Your stylesheets remain W3C-valid (if they were before!).</p>
<p class="for">Browsers simply ignore CSS properties they don't understand, so degradation is graceful.</p>
<p class="for">If JavaScript is disabled browsers will still load your stylesheets, so degradation is graceful.</p>
<p class="for">It is compatible with template-based websites in not requiring page-specific effects scripts to be inserted into mark-up.</p>
<p class="for">When the -webkit- or -moz- prefix gives way to the real deal of W3C-ratified CSS3 we can simply remove the script and move the content to our stylesheet without having to re-design effects elements or edit any mark-up.</p>
<p class="for">If you don't start using CSS3 now you might have retired before it becomes W3C-ratified.</p>
<h4>The negatives</h4>
<p class="against">Turning off your stylesheet does not disable styling loaded via the DOM.</p>
<p class="against">Effects can be targeted at specific web browser engines (like browser-targeting, a double-edged sword that undermines the uniformity of the "web experience").</p>
<p class="against">It could be construed as cheating. It is.</p>
<p>What are your views, if you have any, on the merits or otherwise of this technique?</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F14%2Fhow-to-safely-inject-css3-using-jquery%2F&amp;seed_title=How+to+safely+inject+CSS3+using+jQuery/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>Corners, gradients and shadows with jQuery</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F13%2Fcorners-gradients-and-shadows-with-jquery%2F&amp;seed_title=Corners%2C+gradients+and+shadows+with+jQuery</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F13%2Fcorners-gradients-and-shadows-with-jquery%2F&amp;seed_title=Corners%2C+gradients+and+shadows+with+jQuery#comments</comments>
		<pubDate>Wed, 13 Feb 2008 15:36:40 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[webdev]]></category>

		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/2008/02/13/corners-gradients-and-shadows-with-jquery/</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>Previously we <a href="http://www.bioneural.net/2008/01/06/from-protoaculous-to-jquery/">looked</a> at moving to jQuery, and then at the best way to do corners and gradients using a variety of <a href="http://www.bioneural.net/2008/02/06/the-best-way-to-do-corners-and-gradients/">techniques</a> (Part 1). In this follow-on article (Part 2) I want to share how jQuery can be extended for similar cornering, gradient, and drop shadow visual effects. Although my JavaScript ability is not much beyond "cut and paste" the idea here is to share how easy it is to create these effects for other folk possessed by similar (in)ability.<br />
<span id="more-826"></span></p>
<h4>Situation recap</h4>
<p>In <a href="http://www.bioneural.net/2008/02/06/the-best-way-to-do-corners-and-gradients/">Part 1</a> we explored various ways to make rounded corners, comprising one or more of JavaScript, CSS, Flash, and SVG. Ditto for drop shadows. Implementing a gradient was restricted to the use of background (or inline) images, or to SVG. There are a few more tricks we might try for gradients:</p>
<ul>
<li>We could load a transparent PNG as a CSS background and vary the fill colour on the container to allow for a multitude of colour-graduated boxes without further image editing (see this ALA <a href="http://www.alistapart.com/articles/supereasyblendys" rel="external">article</a>);</li>
<li>Unfortunately the CSS 3 draft as of this writing doesn't include background gradients, but you might be able to fake it using <a href="http://www.css3.info/preview/colored-border/" rel="external">border-color</a>;</li>
<li>We could use JavaScript effects libraries.</li>
</ul>
<p>It turns out we can use JavaScript to create our corners and drop shadows too. There's also a <a href="http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery" rel="external">plugin</a> for using <a href="http://www.curvycorners.net/" rel="external">curvyCorners</a> with jQuery that more than halves the standalone curvyCorners code size.</p>
<h4>Extending jQuery</h4>
<p>While there are some basic <a href="http://docs.jquery.com/Effects" rel="external">effects</a> (hide, toggle, slide, etc.) and manipulation options in the jQuery core API, jQuery <a href="http://ui.jquery.com/" rel="external">UI</a> is a bolt-on library of interactive controls that deal with mouse interaction (e.g. resizing, dragging) and other "user interface" extensions. As of this writing the jQuery documentation is incomplete and the developers in the process of transitioning visual effects formerly included in jQuery UI to a new sister library called jQuery <a href="http://ui.jquery.com/enchant/" rel="external">Enchant</a>. The controls (also referred to as core interaction plugins, UI widgets, or components) are themselves are almost invariably dependent on other jQuery extensions&mdash;needing at least the <a href="http://jquery.com/plugins/project/dimensions" rel="external">Dimensions</a> plugin.</p>
<p>So jQuery needs to get its act together in respect of naming conventions, but perhaps this is more indicative of active development rather than lack of direction? I guess jQuery UI/ Enchant are to jQuery as <a href="http://script.aculo.us/" rel="external">script.aculo.us</a> is to <a href="http://prototypejs.org/" rel="external">Prototype</a>. In a nutshell we're saying that with some jQuery code that in turn requires a bit more extra code in order to work, in addition to the code that is "jQuery" itself&mdash;we can create visual elements like drop shadows! jQuery is thus readily extendible; to use these extra bits of code you just need to load the relevant add-on script in your document head, after having loaded jQuery itself. A picture may help:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/jquery.jpg" width="383" height="326" alt="jquery.jpg" /></p>
<h4>Test cases</h4>
<p>I've used the same basic test box from Part 1, so our core document structure looks like this:</p>
<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;jQuery test cases&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;script type="text/javascript" src="jquery-1.2.3.pack.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="jquery.dimensions.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="jquery.corner.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="jquery.gradient.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="fx.shadow.js"&gt;&lt;/script&gt;
&lt;style type="text/css"&gt;
	...
&lt;/style&gt;
&lt;script type="text/javascript"&gt;
// &lt;![CDATA[
	$(document).ready(function() {
	...
	});
// ]]&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="className"&gt;
	&lt;h4&gt;Lorem ipsum&lt;/h4&gt;
	&lt;p&gt;Lorem ipsum dolor...&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p>With all the necessary libraries loaded we can start adding effects to our div by calling them within <code>$(document).ready()</code> (in place of ... above).</p>
<p class="download">Download the test files <a href="http://www.bioneural.net/docs/jquery-tests.zip">here</a> (.zip archive, 27KB).</p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/jquery-tests/jquery-test.html">live</a> link.</p>
<h4>Case 1: Round corners</h4>
<p>If you wanted to use fancy images to produce round corners yet avoid extra mark-up, you could use <a href="http://15daysofjquery.com/wrap-it-up-pretty-corners/13/" rel="external">this</a> technique. Alternatively use no images at all via the jQuery corner plugin, available <a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/corner/jquery.corner.js" rel="external">here</a>. The plugin supports a variety of corner types and borders as you can see in the <a href="http://malsup.com/jquery/corner/" rel="external">demos</a>. The following call will add cornering with a radius of 20px to a div with the class .cornered:</p>
<pre><code>$('div.cornered').corner("20px");</code></pre>
<p>This will have the following effect on our test box:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/rounded.jpg" width="265" height="346" alt="rounded.jpg" /></p>
<h4>Case 2: Gradients</h4>
<p>The Element gradient plugin, available <a href="http://plugins.jquery.com/project/elementgradient" rel="external">here</a>, will fill an element (e.g. div) with a linear gradient of specified direction (horizontal or vertical only) and opacity. It requires the <a href="http://plugins.jquery.com/project/dimensions/" rel="external">Dimensions</a> plugin. The following call will add a vertical gradient from black to white with 40% opacity to a div with the class .gradient:</p>
<pre><code>$('div.gradient').gradient({ topcolor: '#000000', bottomcolor: '#ffffff', horizontal: false, opacity: 40 });
</code></pre>
<p>This will have the following effect on our test box:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/gradient.jpg" width="262" height="344" alt="gradient.jpg" /></p>
<p>Note that you can't shorten the hex-code (it must be #ffffff not #fff for white, for example).</p>
<p class="info"><em>Tip</em>: If you leave the gradient as black to white with some opacity you can create colour gradients much more easily but changing only the background colour of the container. This is a jQuery version of the ALA super-easy blendy backgrounds <a href="http://www.alistapart.com/articles/supereasyblendys" rel="external">trick</a>.</p>
<h4>Case 3: Borders</h4>
<p>Back to the jQuery corner plugin; it can also do borders using nested elements i.e. one rounded box inside another. So our mark-up could be edited thus:</p>
<pre><code>&lt;div class="xtra"&gt;
&lt;div class="border"&gt;
	&lt;h4&gt;Lorem ipsum&lt;/h4&gt;
	&lt;p&gt;Lorem ipsum dolor...&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>But we don't want to edit our mark-up do we? We don't have to.</p>
<p class="info"><em>Tip</em>: We can make use of <a href="http://docs.jquery.com/Manipulation/wrap#html" rel="external">.wrap()</a> to inject the extra container into our mark-up on-the-fly with JavaScript.</p>
<p>The following calls will add a wrapper div with the class .xtra to our box, then proceed to round our inner box (.border) with a radius of 15px, before padding .xtra with 5px of "border" (whitened with CSS on .xtra) and rounding with a 20px radius:</p>
<pre><code>$('div.border').wrap("&lt;div class='xtra'&gt;&lt;/div&gt;");
$('div.border').corner("15px").parent().css('padding', '5px').corner("20px");</code></pre>
<p>This will have the following effect on our test box:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/border.jpg" width="274" height="356" alt="border.jpg" /></p>
<h4>Case 4: Drop shadows</h4>
<p>In researching this article I came across three ways to create drop shadows using jQuery:</p>
<ul>
<li><a href="http://edgarverle.com/shadow/default.cfm" rel="external">Shadow</a> is an extension that uses tables with multiple rows subject to CSS styling including varying opacity to create a drop shadow illusion;</li>
<li>A <a href="http://15daysofjquery.com/wrap-it-up-lazy-mans-html-generation-with-jquery/10/" rel="external">method</a> that uses images and "onion skin" CSS added via <a href="http://docs.jquery.com/Manipulation/wrap#html" rel="external">.wrap()</a> to add a drop shadow;</li>
<li>UI/Shadow.</li>
</ul>
<p><a href="http://docs.jquery.com/UI/Shadow" rel="external">UI/Shadow</a>, available to download <a href="http://dev.jquery.com/view/trunk/fx/fx.shadow.js" rel="external">here</a>, is being folded into the yet-to-be-released jQuery Enchant library. It wraps your element in nested divs and uses opacity to create the shadow effect. It also requires the <a href="http://plugins.jquery.com/project/dimensions/" rel="external">Dimensions</a> plugin. The following call will add a drop shadow to a div with the class . dropshadow:</p>
<pre><code>$('div.dropshadow').shadow({ color: "#444", offset: 5, opacity: 0.2 });</code></pre>
<p>This will have the following effect on our test box:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/dropshadow.jpg" width="269" height="350" alt="dropshadow.jpg" /></p>
<h4>Combining effects and liquid layouts</h4>
<p>As you can see while the effects in cases 1&ndash;4 work well enough on their own, they sadly don't play together very well (<a href="http://www.bioneural.net/wp-content/uploads/2008/02/jquery-tests/jquery-test.html">see</a> Case 5). Whether this is a limitation in one or more of the plugins, or in my scripting know-how I'm not sure.</p>
<p>It is possible to create a rounded box with a border that adjusts to change in text size or window width, but using an image to render the gradient (<a href="http://www.bioneural.net/wp-content/uploads/2008/02/jquery-tests/jquery-test.html">see</a> Case 6). Because the Dimensions plugin employs absolute positioning, effects that use it (gradients, drop shadows) will "detach" from their elements if you try resizing your browser window or changing text size (see the effect on cases 2, 4, and 5).</p>
<h4>The final score</h4>
<p>To be fair I guess we should use the same scoring system to evaluate jQuery against the other methods we explored in <a href="http://www.bioneural.net/2008/02/06/the-best-way-to-do-corners-and-gradients/">Part 1</a>.</p>
<p><strong>Scoresheet:</strong></p>
<p class="for"><em>Photo background</em>: Supported.</p>
<p class="for"><em>Gradient background</em>: Supported (as image or scripted).</p>
<p class="for"><em>Four rounded corners</em>: Yes.</p>
<p class="for"><em>Border</em>: Yes (without extra mark-up).</p>
<p class="for"><em>Drop shadow</em>: Yes (without images).</p>
<p class="for"><em>Minimal mark-up</em>: Extra containers in mark-up can be avoided with <code>.wrap()</code>.</p>
<p class="against"><em>Static mark-up</em>: Mark-up edited to insert box-specific script.</p>
<p class="for"><em>W3C validity</em>: Yes.</p>
<p class="against"><em>Anti-aliasing</em>: No.</p>
<p class="against"><em>Small footprint</em>: 29KB for jQuery plus 19KB for add-on libraries (background images additional). Of course if you're already using jQuery you need only consider the additional size of any add-ons (e.g. shadows for 6KB).</p>
<p class="for"><em>Graceful degradation</em>: Renders as per the master if JavaScript disabled but liquid layouts may cause problems if width is set on containers added with <code>.wrap()</code>.</p>
<p class="for"><em>Liquidity</em>: Yes, with the proviso that you avoid Dimensions-reliant effects.</p>
<p>Score: 9/12 (probably less, because of problems combining effects)</p>
<p>Not enough to de-throne CSS 3 which <a href="http://www.bioneural.net/2008/02/06/the-best-way-to-do-corners-and-gradients/">scored</a> 11/12, or 12/12 if it were a standard. But CSS 3 isn't here yet and won't be widely supported by all major browsers for some time. jQuery is here, however, and JavaScript is widely supported. </p>
<p>Upon reflection there's something to be said for the elegant simplicity and refined geometry of straight lines and sharp corners. This is how the Dwarves would choose to build websites, leaving curves and soft edges to the Elves. So the ultimate question, really, is do you relate more to Gimli or Legolas? Your answer to that, Middle-earthlings, will decide the direction you should take ;-)</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F13%2Fcorners-gradients-and-shadows-with-jquery%2F&amp;seed_title=Corners%2C+gradients+and+shadows+with+jQuery/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>The best way to do corners and gradients</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F06%2Fthe-best-way-to-do-corners-and-gradients%2F&amp;seed_title=The+best+way+to+do+corners+and+gradients</link>
		<comments>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F06%2Fthe-best-way-to-do-corners-and-gradients%2F&amp;seed_title=The+best+way+to+do+corners+and+gradients#comments</comments>
		<pubDate>Wed, 06 Feb 2008 14:36:17 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[svg]]></category>

		<category><![CDATA[webdev]]></category>

		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.bioneural.net/2008/02/06/the-best-way-to-do-corners-and-gradients/</guid>
		<description><![CDATA[<p><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license" title="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License"><img src="http://www.bioneural.net/wp-content/themes/k2bn/styles/bioneural/cc.png" alt="CC" /></a> From <a href="http://www.bioneural.net/about/terms/">bioneural.net</a>:</p><p>Rounded corners. Yes, they may be a "Web 2.0" fashion fad, but it has been clearly documented that they're a lot easier to <a href="http://www.drivl.com/posts/view/700" rel="external">make</a> than square ones. As part of my <a href="http://www.bioneural.net/2007/12/27/a-xmas-spent-upgrading-bioneuralnet/">overhaul</a> of bioneural.net I've been optimizing much of the code "under the hood", meaning a lot of the changes aren't even visible. Re-evaluating how things are put together, and considering how they could be done more efficiently or otherwise improved is a valuable exercise&mdash;that it scratches a perfectionist itch is an added bonus. In this article I look at a variety of methods for creating boxes with rounded corners and gradients. Yep, it's a showdown!<br />
<span id="more-809"></span></p>
<h4>The traditional approach</h4>
<p>The well-established method of adding corners or gradients to an element is to use multiple background images. Depending to some extent on your content, this is typically impossible to achieve without the use of non-semantic extra mark-up. For example, this box uses to extra and empty divs:</p>
<pre><code>&lt;div class="curvetop"&gt;&lt;/div&gt;
&lt;div class="curvemid"&gt;
	&lt;h2&gt;Willkommen! Welcome!&lt;/h2&gt;
	&lt;p class="german" xml:lang="de" lang="de"&gt;Willkommen auf der Projekt Koru Seite, wo Simone &amp;amp; Bruce die praktischen Aspekte eines Jahres in Neuseeland mit Euch teilen wollen. Eine Einf&amp;uuml;hrung findet Ihr &lt;a href="http://www.bioneural.net/2006/03/17/introducing-project-koru/"&gt;hier&lt;/a&gt; zusammen mit einer &lt;a href="http://www.bioneural.net/2006/03/30/the-teachings-of-te-koru/"&gt;Erkl&amp;auml;rung&lt;/a&gt; warum wir das Koru als Symbol unserer Reise gew&amp;auml;hlt haben.&lt;/p&gt;
	&lt;p class="english"&gt;Welcome to Project Koru, where Simone &amp;amp; Bruce share insight into the practicalities of organizing a year in New Zealand. You can find an introduction to the project &lt;a href="http://www.bioneural.net/2006/03/17/introducing-project-koru/"&gt;here&lt;/a&gt; together with an &lt;a href="http://www.bioneural.net/2006/03/30/the-teachings-of-te-koru/"&gt;explanation&lt;/a&gt; of why we chose the koru as the symbol for our journey.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="curvebottom"&gt;&lt;/div&gt;</code></pre>
<p>Three gradient images (2 having one rounded corner each) could then be loaded into the background of each of the three "layout classes" via CSS:</p>
<pre><code>.curvetop { height: 15px; background: #fff url('gradient-top.png') bottom left no-repeat; display: block; position: relative; margin-top: 10px; }
.curvemid { background: #fff url('gradient-bg.png') repeat-y; padding: 2px 20px !important; display: block; }
.curvebottom { height: 15px; background: #fff url('gradient-bottom.png') top left no-repeat; display: block; position: relative; margin-bottom: 10px; }</code></pre>
<p>The result:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/rounded-welcome.jpg" width="450" height="161" alt="rounded-welcome.jpg"/></p>
<p>You could use this exact same technique for adding embellishments like borders, drop shadows and the like&mdash;but not without some Photoshop skills and a decent collection of bandwidth-hogging images if you needed multiple box styles.</p>
<h4>The challenge</h4>
<p>I devised a box that I thought would test the mettle of any technique. It consisted of just one div containing a header and a paragraph, the text in each of which should appear over a different background with one of these being a gradient (but not necessarily an image). The box should be formed with rounded corners (including on images), a white border, and a drop shadow. It should also have a number of functional characteristics:</p>
<ul>
<li>Minimal mark-up i.e. avoiding nested and/or empty tags;</li>
<li>No changes to mark-up required (but extra CSS allowed, since this could be moved to an external stlesheet);</li>
<li>Valid XHTML and CSS (2.1);</li>
<li><a href="http://en.wikipedia.org/wiki/Anti-aliasing" rel="external">Anti-aliasing</a> on the corners (inner and outer border edges);</li>
<li>Small footprint (let's say under 20KB);</li>
<li>If using JavaScript it should degrade gracefully (i.e. still looks OK if JavaScript is disabled);</li>
<li>Liquid container (adjusting container width to both content size and browser window dimensions).</li>
</ul>
<p class="info">Why the requirement for minimal markup? Forward planning. Eventually CSS3 will arrive, and there'll be no need to scour your database in order to clean out all that redundant mark-up. Just amend your CSS and delete any unemployed images or JavaScript.</p>
<p>My template XHTML and CSS rendered the following:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/master.jpg" width="271" height="354" alt="master.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/master/master-test.html">live</a> link.</p>
<p>Finding a solution to fulfil most if not all of my form and function requirements was going to be something of a mission. There's a useful roundup of techniques <a href="http://www.smileycat.com/miaow/archives/000044.php" rel="external">here</a>, divided into those based on CSS and those based on JavaScript, with examples in both groups requiring anything from no images at all through to eight images. A particular difficulty was finding techniques not restricted by the dimensions of any required image; many of the earlier established methods were clearly devised before the availability of 23" widescreen displays (<a href="http://www.456bereastreet.com/lab/transparent_custom_corners_borders/customised.html">example</a>.)</p>
<p>I made a shortlist (in no particular order) of techniques that looked promising and set to work. I'm not going to post all the code directly into this article or it will become over-long. The files I used for each technique, together with the master template and original full packages where applicable, are available for download should you wish checkout the code or conduct further experiments. I've tested only in Safari and Firefox.</p>
<p class="download">Download the test files <a href="http://www.bioneural.net/docs/corner-tests.zip">here</a> (.zip archive, 428KB).</p>
<h4>Nifty Corners Cube</h4>
<p>First up is <a href="http://www.html.it/articoli/niftycube/index.html" rel="external">Nifty Corners Cube</a> by Alessandro Fulciniti. This method uses JavaScript and CSS; no images other than those you wish to use as backgrounds are required. Here is the result:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/nifty.jpg" width="285" height="366" alt="nifty.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/nifty/nifty-test.html">live</a> link.</p>
<p><strong>Scoresheet:</strong></p>
<p class="for"><em>Photo background</em>: Supported.</p>
<p class="for"><em>Gradient background</em>: Supported.</p>
<p class="for"><em>Four rounded corners</em>: Yes.</p>
<p class="for"><em>Border</em>: While you can produce a <a href="http://www.html.it/articoli/niftycube/nifty11.html" rel="external">convincing</a> rounded border, using padding on the container, this would require extra mark-up in our example in order to retain the cornering on our background images.</p>
<p class="against"><em>Drop shadow</em>: Not supported.</p>
<p class="against"><em>Minimal mark-up</em>: An extra container is required to render a border with inside and outside rounding.</p>
<p class="against"><em>Static mark-up</em>: Mark-up edited to add extra container plus insert box-specific script.</p>
<p class="for"><em>W3C validity</em>: Yes.</p>
<p class="against"><em>Anti-aliasing</em>: Anti-aliasing is not working on the background images or border, although it does work on solid colour boxes in the <a href="http://www.html.it/articoli/niftycube/nifty1.html" rel="external">examples</a>.</p>
<p class="for"><em>Small footprint</em>: 10KB for CSS and JavaScript (background images additional).</p>
<p class="for"><em>Graceful degradation</em>: Renders as per the master if JavaScript disabled.</p>
<p class="for"><em>Liquidity</em>: Overriding fixed width for .cornered (and in the third case for .xtra) supports liquid layouts (case four).</p>
<p>Score: 8/12</p>
<h4>curvyCorners</h4>
<p>Cameron Cooke's <a href="http://www.curvycorners.net/" rel="external">curvyCorners</a> is another image-free JavaScript solution:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/curvy.jpg" width="287" height="373" alt="curvy.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/curvy/curvy-test.html">live</a> link.</p>
<p><strong>Scoresheet:</strong></p>
<p class="for"><em>Photo background</em>: Supported.</p>
<p class="for"><em>Gradient background</em>: Supported.</p>
<p class="against"><em>Four rounded corners</em>: There are rounded corners, but these are rendered adjacent to our background content rather than on top of it. This <a href="http://www.curvycorners.net/examples/demos/demo2.html" rel="external">example</a> illustrates rounding on a background image, but adding a border to the containing div merely fills the cornered area with "extra" offset background (see <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/curvy/offset.jpg">here</a>).</p>
<p class="for"><em>Border</em>: Obtained by applying background and border to container.</p>
<p class="against"><em>Drop shadow</em>: Not a feature of this technique.</p>
<p class="for"><em>Minimal mark-up</em>: Yes.</p>
<p class="against"><em>Static mark-up</em>: Mark-up edited to insert box-specific script.</p>
<p class="for"><em>W3C validity</em>: Yes.</p>
<p class="against"><em>Anti-aliasing</em>: Yes, but only on the outside of the rounded border (not on images).</p>
<p class="against"><em>Small footprint</em>: 24KB for JavaScript (background images additional).</p>
<p class="for"><em>Graceful degradation</em>: Renders as per the master if JavaScript disabled.</p>
<p class="for"><em>Liquidity</em>: Overriding fixed width for .cornered supports liquid layouts (case four).</p>
<p>Score: 7/12</p>
<h4>SRCCB</h4>
<p>The "simple rounded corner CSS boxes" technique was <a href="http://www.modxcms.com/simple-rounded-corner-css-boxes.html" rel="external">devised</a> by Ryan Thrash, also accessible in the form of an online generator as <a href="http://spiffybox.com/" rel="external">Spiffy Box</a>. It uses no JavaScript and a single image combined with moderately complex CSS (which would have to be recalculated for each box size):</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/simple.jpg" width="268" height="374" alt="simple.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/simple/simple-test.html">live</a> link.</p>
<p><strong>Scoresheet:</strong></p>
<p class="for"><em>Photo background</em>: Supported (integrated into container background).</p>
<p class="for"><em>Gradient background</em>: Supported (integrated into container background).</p>
<p class="for"><em>Four rounded corners</em>: Yes (integrated into container background).</p>
<p class="for"><em>Border</em>: Yes (integrated into container background).</p>
<p class="for"><em>Drop shadow</em>: Yes (integrated into container background).</p>
<p class="against"><em>Minimal mark-up</em>: Requires two additional divs for positioning purposes.</p>
<p class="against"><em>Static mark-up</em>: Mark-up edited to insert two additional divs.</p>
<p class="for"><em>W3C validity</em>: Yes.</p>
<p class="for"><em>Anti-aliasing</em>: Yes (integrated into container background).</p>
<p class="for"><em>Small footprint</em>: 6KB image overhead compared to master with original 2 background images.</p>
<p class="for"><em>Graceful degradation</em>: Not applicable as no JavaScript.</p>
<p class="against"><em>Liquidity</em>: Depends upon fixed-width images.</p>
<p>Score: 9/12</p>
<h4>swfIR</h4>
<p>The SWF Image Replacement (<a href="http://www.swfir.com" rel="external">swfIR</a>) technique is offered by Jon Aldinger, Mark Huot, and Dan Mall. It applies to inline (cf background) images and uses JavaScript and Flash to swap out the original and deck it out with bling. It does more than we require&mdash;image rotation and stretching for example, and at first glance it certainly looked like the wrong tool for the job. I wondered, however, if we could use CSS positioning to overlay our text on top of the replaced images. It turns out you can:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/swfir.jpg" width="255" height="394" alt="swfir.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/swfir/swfir-test.html">live</a> link.</p>
<p><strong>Scoresheet:</strong></p>
<p class="for"><em>Photo background</em>: Supported (as an inline image!).</p>
<p class="for"><em>Gradient background</em>: Supported (as an inline image!).</p>
<p class="against"><em>Four rounded corners</em>: Actually you get 6! (you could potentially blot out the bottom border on the heading using a third positioned inline image&mdash;a real hack!).</p>
<p class="for"><em>Border</em>: Yes (specified in JavaScript).</p>
<p class="for"><em>Drop shadow</em>: Yes (specified in JavaScript).</p>
<p class="against"><em>Minimal mark-up</em>: Requires insertion of two inline images.</p>
<p class="against"><em>Static mark-up</em>: Mark-up edited to insert inline images plus box-specific script.</p>
<p class="for"><em>W3C validity</em>: Yes. It does validate, but should I say "No" because it depends on Flash?</p>
<p class="for"><em>Anti-aliasing</em>: Yes.</p>
<p class="against"><em>Small footprint</em>: 25KB (24KB JavaScript and SWF; 1KB image overhead compared to master with original 2 background images.)</p>
<p class="for"><em>Graceful degradation</em>: Acceptable (just) with JavaScript disabled.</p>
<p class="against"><em>Liquidity</em>: Positioning depends upon fixed-width images.</p>
<p>Score: 7/12</p>
<h4>ShadedBorder</h4>
<p>Steffen Ruzee brings you <a href="http://www.ruzee.com/blog/shadedborder" rel="external">ShadedBorder</a>, a full-featured solution that uses only JavaScript:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/shaded.jpg" width="273" height="374" alt="shaded.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/shaded/shaded-test.html">live</a> link.</p>
<p><strong>Scoresheet:</strong></p>
<p class="for"><em>Photo background</em>: Supported.</p>
<p class="for"><em>Gradient background</em>: Supported.</p>
<p class="for"><em>Four rounded corners</em>: Yes.</p>
<p class="against"><em>Border</em>: Yes (specified in JavaScript), but height on .sb-inner causes blue background to show through (why isn't this also an issue with the h4 background image?). Setting height to 0 removes the bar but also takes out the gradient! Admittedly, you could style the background to tone in better.</p>
<p class="for"><em>Drop shadow</em>: Yes (specified in JavaScript).</p>
<p class="against"><em>Minimal mark-up</em>: A headline with it's own style can be <a href="http://www.ruzee.com/files/shadedborder/test.html" rel="external">achieved</a> with extra mark-up, and extra script in the head, and another script that <em>must</em> be inserted before the closing body tag. This makes it fatally flawed for use in a templated system like WordPress, IMHO.</p>
<p class="against"><em>Static mark-up</em>: As above, mark-up edited at 3 points, including a necessary change from div class to ID.</p>
<p class="for"><em>W3C validity</em>: Yes.</p>
<p class="for"><em>Anti-aliasing</em>: Yes.</p>
<p class="for"><em>Small footprint</em>: 9KB JavaScript.</p>
<p class="for"><em>Graceful degradation</em>: Renders as per the master if JavaScript disabled.</p>
<p class="for"><em>Liquidity</em>: Yes (comment out width on #cornered; not shown due to duplicate IDs).</p>
<p>Score: 9/12</p>
<h4>SVG</h4>
<p>Firefox 2 and Safari 3 can both display standalone Scalable Vector Graphics (<a href="http://www.w3.org/TR/SVG/" rel="external">SVG</a>) images, an unloved W3C standard. They can't load SVG from CSS, however, making SVGs unusable as background images at this time. The option to use SVG in CSS hasn't gone beyond a <a href="http://dbaron.org/css/css-vg/" rel="external">proposal</a>, with Wikipedia <a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics" rel="external">noting</a> "the use of SVG on the web is in its infancy". It took me quite a few hours to get to grips with the examples in the 1.1 spec and create a <a href="http://validator.w3.org/check?uri=http%3A//www.bioneural.net/wp-content/uploads/2008/02/corner-tests/svg/svg-test.xhtml" rel="external">valid</a> and functional XHTML/SVG file for testing purposes. The basic idea is to create a bordered box with rounded corners, fill it with a gradient, and apply a <a href="http://en.wikipedia.org/wiki/Gaussian_blur" rel="external">Gaussian blur</a> to a slightly offset box of the same dimensions&mdash;all with a few lines of XML. Here is our box using Opera 9.25 (Mac):</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/svg.jpg" width="279" height="372" alt="svg.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/svg/svg-test.xhtml">live</a> link (SVG-aware browser required).</p>
<p><strong>Scoresheet:</strong></p>
<p class="against"><em>Photo background</em>: Supported in CSS, but you loose the rounded corners.</p>
<p class="for"><em>Gradient background</em>: Supported without CSS via <code>linearGradient</code>.</p>
<p class="for"><em>Four rounded corners</em>: Yes via <code>rx</code> on <code>rect</code>.</p>
<p class="for"><em>Border</em>: Yes via <code>stroke</code> on <code>rect</code>.</p>
<p class="for"><em>Drop shadow</em>: Yes via <code>filter</code> with <code>feGaussianBlur</code>, <code>feOffset</code>, and <code>feMerge</code>.</p>
<p class="against"><em>Minimal mark-up</em>: Requires insertion of inline SVG image(s).</p>
<p class="against"><em>Static mark-up</em>: SVG must (currently) be added inline; also necessitates DOCTYPE change and .xhtml file extension.</p>
<p class="for"><em>W3C validity</em>: Yes.</p>
<p class="for"><em>Anti-aliasing</em>: Yes.</p>
<p class="for"><em>Small footprint</em>: 0KB (background image additional; gradient image not required).</p>
<p class="against"><em>Graceful degradation</em>: No (Internet Explorer 6 and 7 choke).</p>
<p class="against"><em>Liquidity</em>: Positioning depends upon fixed-width SVG images; <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/svg/svg-resize-test.xhtml">resizing</a> text size or browser window is problematic.</p>
<p>Score: 7/12</p>
<p><em>Update 18.03.08</em>: Safari 3.1 <a href="http://docs.info.apple.com/article.html?artnum=307467" rel="external">adds</a> support for SVG images in img elements and CSS images.</p>
<h4>CSS3</h4>
<p><a href="http://www.w3.org/TR/css3-roadmap/" rel="external">CSS3</a>, if it ever arrives, promises not only rounded corners but drop shadows and multiple background images too (oddly the draft spec doesn't mention gradients). Apple's <a href="http://www.apple.com/safari/" rel="external">Safari</a> (available for Mac and PC) already includes support for such effects&mdash;but of course it's not valid CSS. You can preview CSS3 rounded corners <a href="http://www.css3.info/preview/rounded-border/" rel="external">here</a> and <a href="http://24ways.org/2006/rounded-corner-boxes-the-css3-way" rel="external">here</a> in Firefox or Safari 3. Here is our box using Safari-specific not-quite-CSS3:</p>
<p><img src="http://www.bioneural.net/wp-content/uploads/2008/02/css3.jpg" width="293" height="371" alt="css3.jpg" /></p>
<p class="link">Here is the <a href="http://www.bioneural.net/wp-content/uploads/2008/02/corner-tests/css3/css3-test.html">live</a> link (<a href="http://webkit.org/" rel="external">WebKit</a> browser required).</p>
<p><strong>Scoresheet:</strong></p>
<p class="for"><em>Photo background</em>: Supported.</p>
<p class="for"><em>Gradient background</em>: Supported.</p>
<p class="for"><em>Four rounded corners</em>: Yes.</p>
<p class="for"><em>Border</em>: Yes.</p>
<p class="for"><em>Drop shadow</em>: Yes.</p>
<p class="for"><em>Minimal mark-up</em>: Yes.</p>
<p class="for"><em>Static mark-up</em>: Yes.</p>
<p class="against"><em>W3C validity</em>: No, but only because the standard isn't yet established.</p>
<p class="for"><em>Anti-aliasing</em>: Yes, but note anti-aliasing artefact in the bottom corners.</p>
<p class="for"><em>Small footprint</em>: 0KB (background images additional).</p>
<p class="for"><em>Graceful degradation</em>: Yes (non-CSS3 aware browsers see a plain box).</p>
<p class="for"><em>Liquidity</em>: Yes.</p>
<p>Score: 11/12</p>
<h4>Summing up</h4>
<p>Which technique you choose ultimately depends upon what you're after and what you prioritise. There is no one "best" solution that fits all requirements. In terms of form and function CSS3 has to be the clear winner if one must be chosen, with a perfect score blown only by the fact that it isn't a W3C standard (yet). Herein lies CSS3's only significant yet overwhelming drawback: what good is it if the majority users can't see the effects? At the same time I'm not personally sold on any of the alternative methods. The end results may look good; it's <em>how</em> they achieve them that I don't much care for. Although a method validates it typically involves cheating the validator (seemingly JavaScript's <em>raison d'être</em>). Just take a look at the live links with Safari's Web Inspector (<a href="http://www.bioneural.net/wp-content/uploads/2008/02/inspector.jpg">example</a>).</p>
<p>Before I put a lid on this little adventure, as Jobs would <a href="http://en.wikipedia.org/wiki/Stevenote" rel="external">say</a>, there's just <em>one more thing</em>... what about jQuery? The <a href="http://jquery.com/" rel="external">jQuery</a> library (included with WordPress and the K2 theme) can be extended to render corners, shadows, and gradients. If this article was Part 1, then that exposition forms <a href="http://www.bioneural.net/2008/02/13/corners-gradients-and-shadows-with-jquery/">Part 2</a>. <del datetime="2008-02-13T16:15:23+00:00">Coming soon</del>.</p>
<img src="http://www.bioneural.net/ff309e51/26673f11/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]></description>
		<wfw:commentRss>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2008%2F02%2F06%2Fthe-best-way-to-do-corners-and-gradients%2F&amp;seed_title=The+best+way+to+do+corners+and+gradients/feed/</wfw:commentRss>
		<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.954 seconds -->
