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

<channel>
	<title>Jacob Rask</title>
	<atom:link href="http://jacobrask.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://jacobrask.net</link>
	<description>web stuff &#38; who knows what else</description>
	<pubDate>Thu, 12 Nov 2009 14:29:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Opera Delicious button</title>
		<link>http://jacobrask.net/blog/2009/opera-delicious-button/</link>
		<comments>http://jacobrask.net/blog/2009/opera-delicious-button/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 13:52:56 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[internet]]></category>

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

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

		<guid isPermaLink="false">http://jacobrask.net/?p=166</guid>
		<description><![CDATA[A drag-and-drop button for Opera to post bookmarks to Delicious. Supports excerpts in any language.]]></description>
			<content:encoded><![CDATA[<p>The only simple post-to-delicious buttons I&#8217;ve seen for <a href="http://jacobrask.net/blog/tag/opera/">Opera</a> have been outdated and quite limited in their functionality. For instance, excerpts were not supported. So I made a new one:</p>
<p><a href="opera:/button/Go%20to%20page,%22javascript:s='';x=document;y=window;if(x.selection)s=x.selection.createRange().text;else%20if(y.getSelection)s=y.getSelection();else%20if(x.getSelection)s=x.getSelection();location.href='http://delicious.com/save?url='+encodeURIComponent(location.href)+'%26title='+encodeURIComponent(document.title)+'%26notes='+encodeURIComponent(s);%22,%22Save to Delicious%22,,Compose%20mail" title="Save to Delicious">Save to Delicious</a></p>
<p>Just drag and drop it to your toolbar and start using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/opera-delicious-button/feed/</wfw:commentRss>
		</item>
		<item>
		<title>input:invalid:not(:focus)</title>
		<link>http://jacobrask.net/blog/2009/inputinvalidnotfocus/</link>
		<comments>http://jacobrask.net/blog/2009/inputinvalidnotfocus/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 08:55:02 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

		<category><![CDATA[html forms]]></category>

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

		<guid isPermaLink="false">http://jacobrask.net/?p=144</guid>
		<description><![CDATA[The <a href="http://www.w3.org/TR/css3-ui/"><abbr>CSS3</abbr> User Interface Module</a> specifies some new interesting pseudo-class selectors that are useful for enhancing your <abbr>HTML5</abbr> forms. One of them is <code>invalid</code>. ]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.w3.org/TR/css3-ui/"><abbr>CSS3</abbr> User Interface Module</a> specifies some new interesting pseudo-class selectors that are useful for enhancing your <abbr>HTML5</abbr> forms. One of them is <code><a href="http://www.w3.org/TR/css3-ui/#pseudo-validity">invalid</a></code>. </p>
<p>Say you have an <code>input</code> of the type <code>email</code>, and enter something that is not a valid email address. Then the <code>invalid</code> pseudo-selector would apply. If someone is <a href="http://www.w3.org/TR/css3-selectors/#useraction-pseudos">currently typing</a> in their email address however, you might not want it to be marked as invalid, as the user isn&#8217;t done yet. With some advanced <abbr>CSS3</abbr> you can accomplish this. Take a look at the following code:</p>
<pre class="box"><code>input:invalid:not(:focus) {
 background: red;
}</code></pre>
<p>That will make the background of an input red if it is invalid, as soons as the user focuses something else on the page. They can then go back and fix the error. This also applies to inputs with type <code>url</code> or with a specified regexp pattern. As far as I know it is currently only supported in Opera. Do you know if it&#8217;s supported in any nightly builds of other browsers?</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/inputinvalidnotfocus/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Effective CSS editing with Vim</title>
		<link>http://jacobrask.net/blog/2009/vim-css-code-editor/</link>
		<comments>http://jacobrask.net/blog/2009/vim-css-code-editor/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 10:50:55 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

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

		<guid isPermaLink="false">http://jacobrask.net/?p=120</guid>
		<description><![CDATA[I use the Vim text editor to write and maintain all of my code. In this article I describe some benefits Vim has for <abbr>CSS</abbr> coding in particular, and how to add autocompletion for different languages in Vim. And did you know that you can validate your <abbr>CSS</abbr> and <abbr>HTML</abbr> code from inside Vim?]]></description>
			<content:encoded><![CDATA[<p>A while back I started using <a href="http://vim.org">Vim</a> as my code editor of choice. Previously, I used <a href="http://kate-editor.org/">Kate</a> for <abbr title="K Desktop Environment">KDE</abbr>, which is a great and customizable editor, but only available for Unix. At work I have to use many Windows applications, for everything from design to browser testing, which I at home don&#8217;t do as often, so there I use VMware. First, I tested out some different editors, but none were as good as Kate. I figured I should try something completely new, and something I could use regardless of operating system. I finally chose Vim, and I am glad! Personally I just use <a href="http://en.wikipedia.org/wiki/PuTTY">Putty</a> and run Vim at the web server, that&#8217;s the quickest way if you have <abbr title="Secure Shell">SSH</abbr> access. If you prefer a <abbr title="Graphical User Interface">GUI</abbr>, there is <a href="http://www.vim.org/download.php#pc">gVim</a> as well.</p>
<h3>Autocompletion</h3>
<a href="http://jacobrask.net/blog/tag/vim/">Vim</a> supports autocompletion, which means you can start writing for instance <code>bac</code>, press <kbd>Ctrl X</kbd>, then <kbd>Ctrl O</kbd>, and you will get a list of possible properties (ie <code>background:</code>, <code>background-image:</code>, etc). To enable that for <abbr><a href="http://jacobrask.net/blog/tag/css/">CSS</a></abbr> in Vim, enter the following command: <kbd>:set omnifunc=csscomplete#CompleteCSS</kbd></p>
<p>To enable it by default for <abbr>CSS</abbr> files, add the following code to your <a href="http://www.vim.org/htmldoc/usr_05.html#05.1"><code>.vimrc</code></a> file:<br />
<pre class="box"><code class="language-configuration" title="A block of configuration code">autocmd FileType css set omnifunc=csscomplete#CompleteCSS</code></pre>
<p>Autocompletion for many more languages is available in Vim, <a href="http://amix.dk">Amir Salihefendic</a> has written more about it on his blog: <a href="http://amix.dk/blog/viewEntry/19021">Vim 7: Turning completion on</a>. He also has a nice animated example of what it looks like in action.</p>
<p>Another great thing about Vim is that there are a lot of talented users who will write scripts themselves, and share them with anyone. That way, you can find syntax highlighting and autocompletion for almost anything, if not at the <a href="http://www.vim.org/scripts/index.php">official Vim scripts site</a>, just Google it. For instance, I found that <abbr title="YAHOO! User Interface"><a href="http://developer.yahoo.com/yui/">YUI</a></abbr> guru <a href="http://davglass.com">Dav Glass</a> has made both a <a href="http://blog.davglass.com/files/yui/yuivim/">Vim autocompletion and a syntax file</a> for the <abbr title="YAHOO! User Interface">YUI</abbr> JavaScript library.</p>
<h3>Modifying Numerical Values</h3>
<p>Often when debugging a layout, you might want to increase or decrease a numerical value such as <code>width</code> or <code>padding</code>. In Vim&#8217;s command mode, all you have to do is move the cursor to any number, or even the property name, and press <kbd>Ctrl X</kbd> to decrease the value by 1, or <kbd>Ctrl A</kbd> to increase it by 1. You can also enter any number, and then press <kbd>Ctrl X</kbd> or <kbd>Ctrl A</kbd> &mdash; that will increase or decrease the value by the number you entered. Saves you a lot of typing. Works with any unit, such as % or px or whatever.</p>
<h3>Validation</h3>
<p>Vim even supports validating your code directly against a web service. A <a href="http://my.opera.com/cstrep">collegue of mine</a> at Opera wrote a <a href="http://www.vim.org/scripts/script.php?script_id=1577"><abbr>CSS</abbr> validation tool</a>, which I haven&#8217;t tried out yet though. There is also a <a href="http://blog.whatwg.org/vim-checker"><abbr>HTML5</abbr> validation tool</a> at the <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> blog. I will start experimenting with them as soon as I&#8217;ve gotten more comfortable with my current setup.</p>
<p>It <em>does</em> take some effort to learn Vim. The way I did it was to learn only a couple of new commands a day (I just learned how to resize <del>buffers</del> <ins>windows</ins>&#8230;) and have a printed <a href="http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html">cheat sheet</a> on my desk.</p>
<p>Do you have your own Vim tips &#038; tricks? Please share in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/vim-css-code-editor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Useful HTML5 resources</title>
		<link>http://jacobrask.net/blog/2009/useful-html5-resources/</link>
		<comments>http://jacobrask.net/blog/2009/useful-html5-resources/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 12:14:04 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://jacobrask.net/?p=83</guid>
		<description><![CDATA[Interested in <abbr>HTML5</abbr>? I have compiled a collection of links to resources for <abbr>HTML5</abbr> developing, and some recent news in the topic. ]]></description>
			<content:encoded><![CDATA[<p>With the growing interest in <abbr>HTML5</abbr>, I thought I&#8217;d share with you some of the links I&#8217;ve had the most use for when developing a <abbr><a href="http://jacobrask.net/blog/tag/html5/">HTML5</a></abbr> site, and some recent news in the topic. </p>
<h3><a href="http://www.whatwg.org/html5">The Specification</a></h3>
<p>First, <figure class="right" style="width:111px;"><img src="/img/blog/2009/whatwglogo.png" title="The WHATWG logo." width="101" height="101">
<legend><span>The <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> logo.</span></legend>
</figure> of course, the <abbr>HTML5</abbr> Draft Recommendation Specification (hereafter known as the <em>specs</em>). Don&#8217;t be afraid if you didn&#8217;t understand anything of previous <abbr>HTML</abbr> specs, this one is much easier to understand. I prefer the <a href="http://www.whatwg.org/html5">multiple-page version</a>, since the one-page version is very heavy and might hang or lag the browser. <a href="http://www.whatwg.org/html5" class="recommended">Visit</a></p>
<h3><a href="http://blog.whatwg.org">The WHATWG Blog</a></h3>
<p>With writers like <a href="http://diveintomark.org">Mark Pilgrim</a> and <a href="http://ln.hixie.ch">Ian Hickson</a>, the <a href="http://blog.whatwg.org"><abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> blog</a> is useful not only to keep up with the developing specs, but also explaining important concepts such as <a href="http://blog.whatwg.org/the-road-to-html-5-link-relations">link relations</a>, a topicality with all the discussions about <code>rev=canonical</code> recently. <a href="http://blog.whatwg.org" class="recommended">Visit</a></p>
<h3><a href="http://html5gallery.com">html5 Gallery</a></h3>
<p>There are thousands of <em><abbr><a href="http://jacobrask.net/blog/tag/css/">CSS</a></abbr> showcases</em>, but this one has it&#8217;s focus on sites coded with <abbr>HTML5</abbr> markup. A great way to keep up with developers experimenting with new technologies. <a href="http://html5gallery.com" class="recommended">Visit</a></p>
<p><figure class="center" style="width:469px;"><img src="/img/blog/2009/html5gallery.jpg" title="html5 Gallery screenshot." width="459" height="220">
<legend><span>html5 Gallery screenshot.</span></legend>
</figure></p>
<h3><a href="http://a.deveria.com/caniuse/">When can I use&hellip;</a></h3>
<p><a href="http://a.deveria.com">Alexis Deveria</a> has compiled a customizable table of which features in <abbr>HTML5</abbr>, <abbr><a href="http://jacobrask.net/blog/tag/css3/">CSS3</a></abbr>, <abbr>SVG</abbr> are compatible with which browsers. Quite useful when you learn about something new and cool to see if it will work for at least <em>some</em> of your visitors! <a href="http://a.deveria.com/caniuse/" class="recommended">Visit</a></p>
<h3><a href="http://www.brucelawson.co.uk">Bruce Lawson</a></h3>
<p><a href="http://www.webstandards.org/">Web Standards Project</a> member and <a href="http://jacobrask.net/blog/tag/opera/">Opera</a> employee <a href="http://www.brucelawson.co.uk">Bruce Lawson</a> was one of the first major blogs to not only write about, but also redesign his site with <abbr>HTML5</abbr>. <a href="http://www.brucelawson.co.uk" class="recommended">Visit</a></p>
<h3><a href="http://mezzoblue.com/archives/2009/04/20/switched/">Dave Shea</a></h3>
<p>Dave Shea, the author of the popular <a href="http://mezzoblue.com">mezzoblue</a> weblog, recently decided to switch from <abbr>XHTML</abbr> to <abbr>HTML4</abbr>. He did this because he believes <abbr>HTML5</abbr> and not <abbr>XHTML2</abbr> is the future. The ensuing discussion in the comments at his blog is well worth a read. <a href="http://mezzoblue.com/archives/2009/04/20/switched/" class="recommended">Visit</a></p>
<p>That&#8217;s all for now, but please chip in if you have any other resources that might be useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/useful-html5-resources/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuelements &#8212; fixing &lt;q&gt; for IE</title>
		<link>http://jacobrask.net/blog/2009/jquelements-q-ie/</link>
		<comments>http://jacobrask.net/blog/2009/jquelements-q-ie/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 13:18:14 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://jacobrask.net/?p=52</guid>
		<description><![CDATA[A solution to add proper quotation marks, including different quotation marks for different languages, around the <code>q</code> element in all major browsers. Accomplished with <abbr>CSS</abbr> for most browsers and a small jQuery script for <abbr>IE</abbr> prior to version 8.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.w3.org/TR/html401/struct/text.html#h-9.2.2.1">According to the <abbr title="World Wide Web Consortium">W3C</abbr></a>, visual <a href="http://jacobrask.net/blog/tag/browsers/">browsers</a> should render <a href="http://en.wikipedia.org/wiki/Quotation_mark_glyphs">quotation marks</a> around text marked up with the <abbr>HTML</abbr> quote element, <code>q</code>. Modern brow&shy;sers do, but not <a href="http://jacobrask.net/blog/tag/internet-explorer/">Internet Explorer</a> versions prior to 8. This problem was <a href="http://www.alistapart.com/articles/qtag">discussed</a> <a href="http://www.456bereastreet.com/archive/200610/inline_quotations_use_q_elements_or_not/">a lot</a> a few years ago, but I haven&#8217;t seen much about it lately.</p>
<p>Additionally, the <a href="http://www.w3.org/TR/html401/struct/text.html#h-9.2.2.1"><abbr title="World Wide Web Consortium">W3C</abbr> say</a> in the <abbr>HTML4</abbr> specification that:</p>
<blockquote class="box" cite="http://www.w3.org/TR/html401/struct/text.html#h-9.2.2.1"><p>User agents should render quotation marks in a language-sensitive manner (see the lang attribute). Many languages adopt different quotation styles for outer and inner (nested) quotations, which should be respected by user-agents.<span class="bottom"></span></p></blockquote>
<p><abbr title="Internet Explorer 8">IE8</abbr> is currently the only major browser to apply the appropriate quotation marks according to the specified <code>lang</code> attribute by default. Fixing this for Firefox and <a href="http://jacobrask.net/blog/tag/opera/">Opera</a> is relatively straight forward with a little bit of <abbr><a href="http://jacobrask.net/blog/tag/css/">CSS</a></abbr>. <a href="http://monc.se/kitchen/129/rendering-quotes-with-css">David Hellsing</a> wrote a good article on this, and how to get it to work in (older versions?) of Safari as well. First, we specify the <code>quotes</code> property of our <code>q</code> elements, here for English and Swedish:</p>
<pre class="box"><code class="language-CSS" title="A block of CSS code">q:lang(en) { quotes: "\201C" "\201D" "\2018" "\2019"; }
q:lang(sv) { quotes: "\201D" "\201D" "\2019" "\2019"; }</code></pre>
<p>And then the <code>before</code> and <code>after</code> content.</p>
<pre class="box"><code class="language-CSS" title="A block of CSS code">q:before { content: open-quote; }
q:after { content: close-quote; }</code></pre>
<p>Some languages (such as French) have quotation marks that contain spaces, but we don&#8217;t want a quotation mark to appear on a new line. Therefore, it&#8217;s a good idea to add <code>white-space: nowrap;</code> to the <code>before</code> and <code>after</code> code above.</p>
<p>So far so good &mdash; except for Internet Explorer 6 and 7. With Java&shy;Script / <a href="http://jacobrask.net/blog/tag/jquery/">jQuery</a>, we will use <a href="http://www.kryogenix.org/days/2003/04/03/javascriptThe">a method</a> I learned from Stuart Langridge check if the browser has applied the <code>quotes</code> property to the document or not.</p>
<p>The <abbr>IE</abbr> version of accomplishing this is called <code>currentStyle</code>. The <code>q</code> variable is here the first occurrence of a <code>q</code> element in the document. We go through its properties in a for loop, just like we learned from <a href="http://www.kryogenix.org/days/2003/04/03/javascriptThe">Stuart</a>. </p>
<pre class="box"><code class="language-JavaScript" title="A block of JavaScript code">if ( q.currentStyle ) {
 for ( prop in q.currentStyle ) {
  if ( prop == 'quotes' ) {
   supportsQuotes = true;
   break;
  }
 }
}</code></pre>
<p>In <abbr title="Internet Explorer 8">IE8</abbr>, this script will find <code>quotes</code> in the applied properties, and we won&#8217;t have to add any quotation marks with JavaScript. More about that later. To be sure we won&#8217;t add quotation marks for other browsers, we would use a script explained by <a href="http://www.quirksmode.org/dom/getstyles.html">Peter-Paul Koch</a>, using the <code>getComputedStyle</code> method. However, <a href="https://bugs.webkit.org/show_bug.cgi?id=23668">WebKit has a bug</a> preventing this as a reliable method, we will simply have to assume that any browser recognizing the <code>getComputedStyle</code> function will add quotes without JavaScript&hellip;</p>
<pre class="box"><code class="language-JavaScript" title="A block of JavaScript code">else if ( document.defaultView.getComputedStyle )
 supportsQuotes = true;</code></pre>
<p>Now we know if we need to add quotes with JavaScript or not. If we do, we&#8217;ll use some jQuery code. After grabbing the <code>q</code>s with <code>$("q")</code>, we go through the quotes, adding quotation marks. If the quote itself doesn&#8217;t have the <code>lang</code> attribute specified, it will go to the closest parent element with a <code>lang</code> attribute, until it gets to the document root.</p>
<pre class="box"><code class="language-jQuery" title="A block of jQuery code">lang = q.closest("[lang]").attr("lang").toLowerCase();</code></pre>
<p>In the jQuelements settings, we have previously specified a <code>qMarks</code> array for different languages, with a syntax similar to the <abbr>CSS</abbr> above:</p>
<pre class="box"><code class="language-JavaScript" title="A block of JavaScript code">qMarks['en'] = new Array('\u201D','\u201C','\u2018','\u2019');
qMarks['sv'] = new Array('\u201D','\u201D','\u2018','\u2019');</code></pre>
<p>This is what we will now get with the help of our <code>lang</code> variable and apply with some jQuery.</p>
<pre class="box"><code class="language-jQuery" title="A block of jQuery code">qMark = qMarks[lang];
if ( q.parents("q").length == 0 )
 q.before(qMark[0]).after(qMark[1]);
else
 q.before(qMark[2]).after(qMark[3]);</code></pre>
<p>There is some more code involved, obviously. You can download that, the <abbr>CSS</abbr> and more examples with different languages in <a href="http://jacobrask.net/lab/jquelements/">my lab</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/jquelements-q-ie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tabbed navigation with :target</title>
		<link>http://jacobrask.net/blog/2009/tab-navigation-menu-css-target/</link>
		<comments>http://jacobrask.net/blog/2009/tab-navigation-menu-css-target/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 10:44:27 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://jacobrask.net/?p=40</guid>
		<description><![CDATA[Using the <abbr>CSS3</abbr> <code>target</code> pseudo-class, you can easily hide and show elements with a simple anchor link, without having to use any JavaScript at all!]]></description>
			<content:encoded><![CDATA[<p>It was not until recently I learned about the <abbr>CSS3</abbr> pseudo-class <code>target</code>. In my old design, I linked elements to page headers via my Table of Contents and marked the headers in different ways &mdash; not visible in all browsers, but progressive enhancement. </p>
<p>In the process of redesigning my site, I wanted a small tabbed inter&shy;face in a sidebar and started working on a <a href="http://jacobrask.net/blog/tag/jquery/">jQuery</a> script to accomplish that, when I realized I could use the <code>target</code> pseudo-class instead! Nothing more than the following is needed:</p>
<pre class="box"><code class="language-HTML" title="A block of HTML code">&lt;ul&gt;
 &lt;li&gt;&lt;a href="#tab1"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#tab2"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#tab3"&gt;Tab 3&lt;/a&gt;&lt;/li&gt;
&gt;/ul&lt;</code></pre>
<p>That is the navigation. And the targets:<br />
<pre class="box"><code class="language-HTML" title="A block of HTML code">&lt;div id="tab1"&gt;Lorem ipsum dolor sit amet&lt;/div&gt;
&lt;div id="tab2"&gt;consectetur adipiscing elit&lt;/div&gt;
&lt;div id="tab3"&gt;Nullam vitae ligula eget erat suscipit sodales.&lt;/div&gt;</code></pre></p>
<p>The <abbr>CSS</abbr> to hide the content by default:<br />
<pre class="box"><code class="language-CSS" title="A block of CSS code">#tab1:not(:target), #tab2:not(:target), #tab3:not(:target) {
 display: none;
}</code></pre></p>
<p>Using the <code>not</code> pseudo-class here makes sure the boxes are not hidden from browsers not supporting <abbr>CSS3</abbr> properly. And to show them when the links are clicked:</p>
<pre class="box"><code class="language-CSS" title="A block of CSS code">#tab1:target, #tab2:target, #tab3:target {
 display: block;
}</code></pre>
<p>Obviously, the Internet is big and when I <a href="http://www.google.com/search?q=css+tab+target">googled</a>, I realized I was hardly <a href="http://daniel.glazman.free.fr/weblog/archived/2003_01_05_glazblogarc.html#87183885">the first one</a> to come up with this. Actually, it is even included in the <a href="http://www.w3.org/Style/Examples/007/target"><abbr>W3C</abbr>&#8217;s <abbr>CSS</abbr> Tips &amp; Tricks</a>. So, for a demonstration go there, and wait a couple of weeks to see it in action on my site as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/tab-navigation-menu-css-target/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Easy HTML5 image replacement</title>
		<link>http://jacobrask.net/blog/2009/image-replacement-html5/</link>
		<comments>http://jacobrask.net/blog/2009/image-replacement-html5/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 16:51:37 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://jacobrask.net/?p=24</guid>
		<description><![CDATA[An easy way to markup a <abbr>HTML5</abbr> header and style it with a neat image replacement technique.]]></description>
			<content:encoded><![CDATA[<p>There are more <a href="http://www.mezzoblue.com/tests/revised-image-replacement/">image replacement techniques</a> than one can count out there. One I often use is the <a href="http://phark.typepad.com/phark/2003/08/accessible_imag.html">Phark Method</a> (using a nega&shy;tive <code>text-indent</code> to hide the text), which requires no additional <abbr><a href="http://jacobrask.net/blog/tag/html/">HTML</a></abbr> markup. It does cause some issues with the focus area of the link, if it is a link, which will stretch out to where the text is indented, if not speci&shy;fying <code>overflow: hidden;</code>. On this site, however, I use a different approach.</p>
<p>I usually want to link the logo / header image of a site to the home page, and as <a href="http://www.brucelawson.co.uk/2008/any-element-linking-in-html-5/">Bruce Lawson</a> has pointed out, not only is wrapping any element in an <code>a</code> element valid <abbr><a href="http://jacobrask.net/blog/tag/html5/">HTML5</a></abbr>, it is also well supported in <a href="http://jacobrask.net/blog/tag/browsers/">web browsers</a>. Thus, my header is markuped as follows:</p>
<pre class="box"><code class="language-HTML" title="A block of HTML code">&lt;header&gt;
 &lt;a href="http://jacobrask.net"&gt;
  &lt;h1&gt;Jacob Rask&lt;/h1&gt;
  &lt;p&gt;&lt;strong&gt;web stuff&lt;/strong&gt; &amp;amp; who knows what else&lt;/p&gt;
 &lt;/a&gt;
&lt;/header&gt;</code></pre>
<p>And the (relevant) <abbr>CSS</abbr>:<br />
<pre class="box"><code class="language-CSS" title="A block of CSS code">header a {
 display: block;
 background: url(/img/jacobrask.gif) no-repeat;
 height: 60px;
 width: 300px;
}
header a h1 {
 display: none;
}</code></pre></p>
<p>Very easy, and no superfluous markup.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/image-replacement-html5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HTML5 CSS reset</title>
		<link>http://jacobrask.net/blog/2009/html5-css-reset/</link>
		<comments>http://jacobrask.net/blog/2009/html5-css-reset/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 12:30:16 +0000</pubDate>
		<dc:creator>Jacob Rask</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://jacobrask.net/?p=13</guid>
		<description><![CDATA[Some basic (re)setting of <code>CSS</code> properties, adapted for use with <abbr>HTML5</abbr> documents.]]></description>
			<content:encoded><![CDATA[<p>Though <a href="http://meyerweb.com/eric/thoughts/2007/04/18/reset-reasoning/">reseting</a> <a href="http://jacobrask.net/blog/tag/css/"><abbr>CSS</abbr></a> is a <a href="http://snook.ca/archives/html_and_css/no_css_reset/">controversial</a> practice, when it comes to <a href="http://jacobrask.net/blog/tag/html5/"><abbr>HTML5</abbr></a> we <em>inevitably need</em> to specify some default <abbr>CSS</abbr> styles for the new ele&shy;ments, since unknown elements are treated by browsers as if they were inline elements.</p>
<p>Thus, we need a (re)set stylesheet to tell the browser that <code>header</code>, <code>sec&shy;tion</code>, etc, should be <strong>block level elements</strong>. Thus, we might just as well add some other useful declarations to the style sheet. I believe <a href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer&#8217;s <abbr>CSS</abbr></a> reset is a good start, but I think he goes a bit <a href="http://dutchcelt.nl/weblog/css_reset/">too far</a> at some places, such as removing default quotation marks and list-items, so I&#8217;ve trim&shy;med it down. Of course, I have also removed any references to <a href="http://www.w3.org/TR/html5-diff/#absent-elements">ele&shy;ments removed in <abbr>HTML5</abbr></a>.</p>
<pre class="box"><code class="language-CSS" title="A block of CSS code">html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small,  strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
 margin: 0;
 padding: 0;
 border: 0;
 font-size: 100%;
 vertical-align: baseline;
}
body {
 line-height: 1;
}
table {
 border-collapse: collapse;
 border-spacing: 0;
}
section, article, aside, header, footer, nav, dialog, figure {
 display:block;
}</code></pre>
<p>Or download it minified here: <a href="/lab/css-reset/html5-reset.css"><abbr>HTML5</abbr> <abbr>CSS</abbr> reset</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jacobrask.net/blog/2009/html5-css-reset/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
