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

<channel>
	<title>CSS Wizardry</title>
	<atom:link href="http://csswizardry.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://csswizardry.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 04 Feb 2010 16:43:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Upside down domains&#8212;registering an international domain name</title>
		<link>http://csswizardry.com/2010/02/upside-down-domainsregistering-an-international-domain-name/</link>
		<comments>http://csswizardry.com/2010/02/upside-down-domainsregistering-an-international-domain-name/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 15:44:17 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[domains]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=672</guid>
		<description><![CDATA[Earlier today I registered the domain http://ʎɹɹɐɥ.com. Or did I? Upon reading an article by Sam Brown, which in turn linked to an article by John Sutherland explaining how to register such domains, I wanted one. There are a few levels to this trickery. There&#8217;s the &#8216;Oh I totally understand how this works!&#8217;, or there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>E</span>arlier today</span> I registered the domain <a href="http://ʎɹɹɐɥ.com">http://ʎɹɹɐɥ.com</a>. Or did I? Upon reading <a href="http://sam.brown.tc/entry/417/how-to-register-an-international-domain-name">an article by Sam Brown</a>, which in turn linked to <a href="http://sneeu.com/blog/2010/1/how-register-international-domain-name/">an article by John Sutherland</a> explaining how to register such domains, I wanted one. There are a few levels to this trickery. There&#8217;s the <q>&#8216;Oh I totally understand how this works!&#8217;</q>, or there&#8217;s the <q>&#8216;I don&#8217;t want to know how it works, I just want it!&#8217;</q> level.</p>
<p><span id="more-672"></span></p>
<h2>I just want one!</h2>
<p>Okay, I didn&#8217;t actually register<code> http://ʎɹɹɐɥ.com/</code>, I registered what you might call its alias: <code>http://xn--jna6b0ca7h.com</code>. So, by that token, you find the upside down version of your domain (mine being <code>harry</code>) via this <a href="http://www.sevenwires.com/play/UpsideDownLetters.html">upside down letter converter</a>, paste the result (mine being <code>ʎɹɹɐɥ</code>) into <a href="http://mct.verisign-grs.com/conversiontool/">this IDN converter</a> and add whatever domain extension (mine being .com) to the resulting string (mine being <code>xn--jna6b0ca7h</code>). You then register the outcome, and you can access it via the upside down version! <code>http://ʎɹɹɐɥ.com/</code> is just an alias of <code>http://xn--jna6b0ca7h.com/</code> in a sense&#8230;</p>
<p>If you view the source of this page you&#8217;ll see the markup actually links to <code>http://ʎɹɹɐɥ.com/</code> but resolves to <code>http://xn--jna6b0ca7h.com/</code> in the status bar when you hover it.</p>
<h2>I want details!</h2>
<p>If you want to actually understand the technicalities behind it, you ought to read the two articles linked previously.</p>
<h2>Why would I need this?</h2>
<p>You don&#8217;t, but it is cool, right? Although, you could use it as a pretty nifty short-URL for your blog on Twitter like Daring Fireball&#8217;s awesome <a href="http://✪df.ws">http://✪df.ws</a> one.</p>
<h3>Which leads me on to&#8230;</h3>
<p>You don&#8217;t have to have an upside down domain, you can use glyphs in there too. Grab some glyphs from <a href="http://copypastecharacter.com/">CopyPasteCharacter</a> and pop those into the converter too.</p>
<h3>Registering your domain</h3>
<p class="marginalia">This is not a plug&#8230;</p>
<p>I&#8217;ve heard reports of people being asked about languages for the IDNs from their registrar of choice. I went with <a href="http://www.heartinternet.co.uk/">Heart Internet</a> and registered <code>http://xn--jna6b0ca7h.com/</code> no trouble, just as if it was a regular domain.</p>
<p>Be sure to comment it you buy/have bought one yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/02/upside-down-domainsregistering-an-international-domain-name/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CSS bar charts&#8212;styling data with CSS3 and progressive enhancement</title>
		<link>http://csswizardry.com/2010/02/css-bar-charts-styling-data-with-css3-and-progressive-enhancement/</link>
		<comments>http://csswizardry.com/2010/02/css-bar-charts-styling-data-with-css3-and-progressive-enhancement/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 23:59:27 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[data visualisation]]></category>
		<category><![CDATA[progressive enhancement]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=601</guid>
		<description><![CDATA[Bar charts in CSS are neither very new, or very difficult. Using some pretty basic styling you can force lists etc into resembling graphs and charts fairly easily. Such charts, in their most basic form, work perfectly well in displaying and presenting the data they represent. However, using some rich CSS3 and progressive enhancement, you [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>B</span>ar charts</span> in CSS are neither very new, or very difficult. Using some pretty basic styling you can force lists etc into resembling graphs and charts fairly easily. Such charts, in their most basic form, work perfectly well in displaying and presenting the data they represent. However, using some rich CSS3 and progressive enhancement, you can really start pushing the display and presentation of these normally boring documents to the next level. They are also an ideal way in which to demonstrate the power and ability of progressive enhancement.</p>
<h2><a href="/demos/graphs/">View demo</a></h2>
<p><span id="more-601"></span></p>
<p class="marginalia"><strong>Look at the site in IE8, <em>then</em> Firefox, <em>then</em> Safari/Chrome.</strong> Keep refreshing.</p>
<p>I have created <a href="/demos/graphs/">a demo page</a> which simply represents three items of data expressed as percentages. It is not the data itself or the numbers we are concerned with here&mdash;it is the proof of concept. The fact that this can be done on my made up data shows that you can do it too, on real life information.</p>
<h2>Progressive enhancement</h2>
<p class="marginalia">At <a href="http://venturelab.co.uk/">Venturelab</a>, we decided to use progressive enhancement as a matter of course. CSS3 and designing in the browser all the way!</p>
<p>Progressive enhancement is, in my opinion, one of the most exciting schools of thought web development has seen in years (though I <em>have</em> only been in the web for three&#8230;). It is the idea whereby any non-essential features (i.e. anything whose absence will have no adverse effect on the usability or accessibility of a website) are added to the website in a <em>progressive</em> manner&mdash;usually through CSS3.</p>
<p>The benchmark example is rounded corners; to apply these through old means, for example with images, would have taken a developer a substantial amount of time&mdash;time the client is paying for. It seems silly now to think that way-back-when, putting rounded corners on a <code>div</code> might have taken upward of 30 minutes, when we can apply it in about 5 seconds using <code>-moz-border-radius:5px;</code>.</p>
<p>It really is a no brainer&mdash;anyone visiting the site in a browser with no CSS3 support will see square corners. Does this matter? Of course it doesn&#8217;t. No one visits a site to look solely at the design&mdash;they visit for content. Does it matter to them what shape the corners of your RSS button are? No again. Progressive enhancement saves you time, and your client money.</p>
<h3>Isn&#8217;t this just graceful degradation?</h3>
<p class="marginalia">Graceful degradation = building for the best and getting worse; progressive enhancement = building to cater the worst and getting better&#8230;</p>
<p>The line between progressive enhancement and graceful degradation is fine but significant. Graceful degradation is the idea that you&#8217;d build a site for, say, Firefox, then selectively break and <em>downgrade</em> it in the likes of IE(6). Progressive enhancement takes a much more positive attitude in that you build <em>for</em> IE(6) and then selectively <em>upgrade</em> it in browsers like Firefox and Safari. It&#8217;s no longer starting great and getting worse, it&#8217;s now starting great and getting better.</p>
<h3>Internet Explorer</h3>
<p class="marginalia"><strong>N.B.</strong> Only tested in IE8 as this is not a final solution, rather a proof-of-concept.</p>
<p>Internet Explorer(8)&#8217;s take on my bar charts is as you&#8217;d expect from any browser, it renders it perfectly well, providing clear, accessible content, with a flawless UX and perfectly usable. <em>This is not bad!</em> We don&#8217;t need to downgrade anything, this is our starting point. It looks good and it functions perfectly. If you did as above and visited in IE8 first, you wouldn&#8217;t know that there were round corners missing&mdash;because that <em>doesn&#8217;t</em> matter.</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/02/ie.gif" alt="A screenshot of the CSS bar chart in Internet Explorer 8" width="640" height="92" class="full" /></p>
<h3>Firefox</h3>
<p>Next up is Firefox, where we add some round corners to the blue bars, and also a very subtle drop shadow (<code>text-shadow:;</code>) on the text. This is no more usable than before, the content is no more accessible than in IE, but it <em>does</em> look a tad nicer.</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/02/firefox.gif" alt="A screenshot of the CSS bar chart in Firefox" width="640" height="92" class="full" /></p>
<h3>Safari/Chrome</h3>
<p>It is in Webkit based browsers such as Safari and Chrome that the real magic happens. Webkit&#8217;s proprietary CSS is above and beyond that of any other rendering engine&#8230;</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/02/safari.gif" alt="A screenshot of the CSS bar chart in Safari" width="640" height="92" class="full" /></p>
<p>What if I couldn&#8217;t be bothered opening Photoshop to make a subtle gradient <code>.gif</code> for the bars? No worries, use Webkit&#8217;s gradient CSS. A little reflection might look nice on the bars too, but I don&#8217;t fancy any superfluous markup or <code>.png</code>s to fiddle with. Ah great, Webkit has a bit of reflection CSS too.</p>
<p>However, for the real show-piece, the Webkit animation. I&#8217;m not using any Javascript libraries anywhere else in the page so I don&#8217;t fancy pulling a whole one in for something that won&#8217;t really be missed if it&#8217;s not there. I hear Webkit has animations&#8230; magic!</p>
<h2>The code</h2>
<p>Now that&#8217;s the theory covered, let&#8217;s look at what does all this stuff&#8230; Please note, I have used some PHP to randomise the values used by the bars of the chart. As a result, some CSS appears in the source code of the PHP file, and the rest in <a href="http://csswizardry.com/demos/graphs/css/style.css" title="The CSS file which powers the CSS3 bar chart">the page&#8217;s CSS file</a>. The code shown in the examples below is condensed into one large chunk.</p>
<h3>The markup</h3>
<p>The markup simply comprises of one uncluttered <code>dl</code>. The reasoning behind a definition list is that each item is a title, followed by some information about that title. Not only is this semantically correct, it&#8217;s a nice set of elements to be working with to achieve the layout we&#8217;ve got.</p>
<pre><code>&lt;dl id=&quot;chart&quot;&gt;
  &lt;dt&gt;Sales increase this week&lt;/dt&gt;
  &lt;dd&gt;&lt;span id=&quot;data-one&quot;&gt;47%&lt;/dd&gt;
  &lt;dt&gt;Revenue increase this week&lt;/dt&gt;
  &lt;dd&gt;&lt;span id=&quot;data-two&quot;&gt;59%&lt;/dd&gt;
  &lt;dt&gt;Profit increase this week&lt;/dt&gt;
  &lt;dd&gt;&lt;span id=&quot;data-three&quot;&gt;26%&lt;/dd&gt;
&lt;/dl&gt;</code></pre>
<p>That&#8217;s all there is to it.</p>
<h3>The CSS, CSS3 and progressive enhancement</h3>
<pre><code><span class="code-comment">/*------------------------------------*\
  CHART
\*------------------------------------*/</span>
#chart{
  width:520px;
}
#chart dt{
  width:160px;
  float:left;
  margin:0 20px 5px 0;
  padding:2px 0;
  display:inline;
  font-weight:bold;
  text-align:right;
}
#chart dd{
  width:339px;
  border-right:1px solid #ddd;
  float:left;
  margin-bottom:5px;
  display:inline;
}
#chart dd span{
  color:#fff;
  background:#09f;
  text-align:center;
  padding:2px 0;
  display:block;

  text-shadow:1px 1px 1px rgba(0,0,0,0.2);
  -moz-border-radius:2px;
  -webkit-border-radius:2px;
  border-radius:2px;
  background:-webkit-gradient(linear, left top, &rarr;
  left bottom, from(#09f), to(#077fd0));
  -webkit-box-reflect:below 0 &rarr;
  -webkit-gradient(linear, left top, &rarr;
  left bottom, from(rgba(0,0,0,0)), to(rgba(0,0,0,0.25)));
}
#data-one{
  width:47%;
}
#data-two{
  width:59%;
}
#data-three{
  width:26%;
}
#data-one{
  -webkit-animation-name:bar-one; <span class="code-comment">/* Give the bar an animation with a
    unique name */</span>
}
#data-two{
  -webkit-animation-name:bar-two; <span class="code-comment">/* Give the bar an animation with a
    unique name */</span>
}
#data-three{
  -webkit-animation-name:bar-three; <span class="code-comment">/* Give the bar an animation with a
    unique name */</span>
}
#data-one,#data-two,#data-three{ <span class="code-comment">/* Define animation styles for all three
    bars at once */</span>
  -webkit-animation-duration:0.5s; <span class="code-comment">/* Animation duration in seconds */</span>
  -webkit-animation-iteration-count:1; <span class="code-comment">/* Amount of times to loop */</span>
  -webkit-animation-timing-function:ease-out; <span class="code-comment">/* Ease in, out etc. */</span>
}
@-webkit-keyframes bar-one{
  0%{ <span class="code-comment">/* Define bar-one styles at 0% (0 seconds) */</span>
    width:0%;
  }
  100%{ <span class="code-comment">/* Define bar-one styles at 100% (0.5 seconds) */</span>
    width:47%;
  }
}
@-webkit-keyframes bar-two{
  0%{ <span class="code-comment">/* Define bar-two styles at 0% (0 seconds) */</span>
    width:0%;
  }
  100%{ <span class="code-comment">/* Define bar-two styles at 100% (0.5 seconds) */</span>
    width:59%;
  }
}
@-webkit-keyframes bar-three{
  0%{ <span class="code-comment">/* Define bar-three styles at 0% (0 seconds) */</span>
    width:0%;
  }
  100%{ <span class="code-comment">/* Define bar-three styles at 100% (0.5 seconds) */</span>
    width:26%;
  }
}</code></pre>
<h4>In detail</h4>
<p>There may well be some bits in there that you&#8217;re not familiar with, particularly CSS animations. Basically, to animate an element you need to do a few things:</p>
<ol>
<li>Assign the element an animation name. This name is the &#8216;hook&#8217; to link an animation, defined later, to an element.
<pre><code>#data-one{
  -webkit-animation-name:bar-one;
}</code></pre>
</li>
<li>Assign the element animation properties. Here you set things like duration, repetition and ease-in/out.
<pre><code>#data-one,#data-two,#data-three{
  -webkit-animation-duration:0.5s;
  -webkit-animation-iteration-count:1;
  -webkit-animation-timing-function:ease-out;
}</code></pre>
</li>
<li>Set up the keyframes of the animation. Here you set the various points. Here we have one thing to animate through two states, so we simply set a beginning at 0% and and end at 100%. We could set at any percentage in between but as we just have a beginning and an end, we don&#8217;t need to&mdash;Webkit sees to that.
<pre><code>@-webkit-keyframes bar-one{
  0%{
    width:0%;
  }
  100%{
    width:47%;
  }
}</code></pre>
</li>
</ol>
<p>With regards the Webkit reflections, it may be a better idea to consult the <a href="http://webkit.org/blog/182/css-reflections/" title="Surfin&rsquo; Safari article on Webkit reflections">Surfin&#8217; Safari page on that</a>, as anything I&#8217;d say would most likely be a poorly pulled off rehash.</p>
<h2>Closing word</h2>
<p>So there you have it, a real life, justifiable and wholly appropriate application of CSS3 and progressive enhancement coupled with data visualisation. Don&#8217;t be held back by the limitations of older browsers&mdash;relish in the opportunities new ones bring.</p>
<p>And as a final bonus, <a href="http://twitter.com/VIPickering" title="Vincent Pickering on Twitter">@VIPickering</a> requested <a href="/demos/graphs/index2.php" title="A slightly more extravagant version of the same chart">this (view in Safari/Chrome)</a>&#8230; enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/02/css-bar-charts-styling-data-with-css3-and-progressive-enhancement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Wizardry Netvibes widget</title>
		<link>http://csswizardry.com/2010/02/css-wizardry-netvibes-widget/</link>
		<comments>http://csswizardry.com/2010/02/css-wizardry-netvibes-widget/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 11:04:54 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[CSS Wizardry]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[netvibes]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=593</guid>
		<description><![CDATA[For those of you that read CSS Wizardry and use Netvibes, I have created a small search widget which you may be interested in adding to your Netvibes page. The widget is simply a small search form, from which you can search all the current articles on the CSS Wizardry site. All you need to [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>F</span>or</span> those of you that read CSS Wizardry <em>and</em> use <a href="http://www.netvibes.com/" title="Netvibes personal start page">Netvibes</a>, I have created <a href="http://eco.netvibes.com/widgets/295220/css-wizardry-search" title="The CSS Wizardry search widget on Netvibes">a small search widget</a> which you may be interested in adding to your Netvibes page. The widget is simply a small search form, from which you can search all the current articles on the CSS Wizardry site. All you need to do is head to <a href="http://eco.netvibes.com/widgets/295220/css-wizardry-search" title="The CSS Wizardry search widget on Netvibes">the widget&#8217;s page</a> and hit &#8216;Add to Netvibes&#8217;.</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/02/widget.jpg" alt="A screenshot of the CSS Wizardry Netvibes widget" width="270" height="173" class="left polaroid" /></p>
<p>From my point of view, creating the widget could not have been simpler&mdash;simply writing some basic form HTML which posts to the blog will yield results, and it then just requires dropping into an XML document and placing on a live server, and linking to via the Netvibes developer centre.</p>
<p>You can view the &#8216;master&#8217; XML document here: <a href="http://csswizardry.com/netvibes/index.xml">http://csswizardry.com/netvibes/index.xml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/02/css-wizardry-netvibes-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone CSS&#8212;tips for building iPhone websites</title>
		<link>http://csswizardry.com/2010/01/iphone-css-tips-for-building-iphone-websites/</link>
		<comments>http://csswizardry.com/2010/01/iphone-css-tips-for-building-iphone-websites/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 20:17:10 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=489</guid>
		<description><![CDATA[With the rapid rise in mobile browsers, it has probably never been more important to ensure your sites can be handled on these platforms. By far one of the most popular such browsers is Mobile Safari on the iPhone&#8212;this is one of the easiest browsers to develop for: it runs on Webkit (meaning a lot [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>W</span>ith</span> the rapid rise in mobile browsers, it has probably never been more important to ensure your sites can be handled on these platforms. By far one of the most popular such browsers is Mobile Safari on the iPhone&mdash;this is one of the easiest browsers to develop for: it runs on Webkit (meaning a lot of rich CSS3 support) and it&#8217;s only ever on one resolution and on one OS.</p>
<p class="marginalia"><ins datetime="2010-02-02T10:26:37+00:00"><strong>N.B.</strong> This article addresses iPhone development and iPhone development only. There is no reason why you cannot or should not develop for other mobile devices and platforms, Apple or otherwise. <em>This just happens to be an iPhone only post</em>.</ins></p>
<p>The practical upshot of this is that you need to do no cross-browser testing, and can use all the <a href="/css3/">CSS3</a> you like. This post will show you some of the basics of developing and designing websites for the iPhone and Mobile Safari.</p>
<p><span id="more-489"></span></p>
<h2>To start</h2>
<p>The first thing to remember when developing a site to be displayed on an iPhone is that it is <em>very</em> similar to designing a print stylesheet. <em>You need to linearise everything.</em> Make sure you have one column and everything is read in one line&mdash;straight from top to bottom. This will also put your markup writing skills to the test.</p>
<p class="marginalia">Some people don&#8217;t agree with browser sniffing, but you need to detect the iPhone somehow.</p>
<p>This first bit of code is a PHP browser sniffing snippet, the actual CSS we&#8217;ll use is not brought through via any server side code, we&#8217;ll use some CSS media queries for that. What we&#8217;ll use this code for is serving the markup with an iPhone specific meta tag and to shorten the current page&#8217;s title.</p>
<pre><code>&lt;?php
  $browser = strpos($_SERVER['HTTP_USER_AGENT'],&quot;iPhone&quot;);
    if ($browser == true){
    $browser = 'iphone';
  }
?&gt;</code></pre>
<p>What the above code does is sees if the user agent contains any instance of &#8216;iPhone&#8217; using <a href="http://uk2.php.net/strpos">the <code>strpos</code> PHP function</a>. Place this piece of code at the very top of your header include, before any other markup. In order to action something if the browser <em>is</em> an iPhone, simply use the following bit of PHP logic in the place you want it to be initiated:</p>
<pre><code>&lt;?php if($browser == 'iphone'){ ?&gt;DO THIS&lt;?php } ?&gt;</code></pre>
<p class="marginalia">We want people to save your site to their home screen&#8230;</p>
<p>Now, to put that snippet to use. We want to do two things with this little piece of PHP.</p>
<h3>Saving to the homescreen&mdash;shortening the page title</h3>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/01/iphone-01.jpg" alt="An iPhone screenshot of the CSS Wizardry home screen icon" width="160" height="160" class="left" /></p>
<p>First off, we&#8217;d like users to be able to save a link to your site on their home screen, this is simple enough, they simply need to select to do so from within the browser. However, if you look at the title of my home page alone, it&#8217;s quite long: <q>CSS Wizardry&mdash;CSS, Web Standards, Typography, and Grids by Harry Roberts</q>. This would never fit underneath an icon without being shortened, so we need to serve a different title to the iPhone only. To achieve this we us the PHP snippet like so:</p>
<pre><code>&lt;?php if($browser == 'iphone'){ ?&gt;
  &lt;title&gt;Short iPhone only title&lt;/title&gt;
&lt;?php }else{ ?&gt;
  &lt;title&gt;Regular title&lt;/title&gt;
&lt;?php } ?&gt;</code></pre>
<p>Now, both when browsing and saving your site to their home screen, a user will only ever see the shortened version.</p>
<h4>The home screen icon</h4>
<p>Actually making the icon is very simple. All you need to do is upload a 57&#215;57px icon (usually a larger version of your favicon) to your server root. The icon must be named <code>apple-touch-icon.png</code>, and the iPhone will sort the rest out. See <a href="http://csswizardry.com/apple-touch-icon.png" title="Link to a png iPhone icon">my icon</a>.</p>
<h3>Stopping user pinch-zooming</h3>
<p>The second use for the PHP snippet is to serve the iPhone a meta tag which disables the user pinch-zoom that Mobile Safari offers:</p>
<pre><code>&lt;?php if($browser == 'iphone'){ ?&gt;
  &lt;meta name=&quot;viewport&quot;
  content=&quot;width=device-width,
  minimum-scale=1.0, maximum-scale=1.0&quot; /&gt;
&lt;?php } ?&gt;</code></pre>
<p>This means that, once we&#8217;ve linearised the content and sorted the font sizing, the user will only ever have to traverse down your page, much like a native app.</p>
<h2>Beginning styling</h2>
<p class="marginalia">Some developers prefer to redirect iPhone users to a totally different version of the site&mdash;we won&#8217;t be doing that.</p>
<p>We could use the PHP snippet to serve the iPhone a whole new stylesheet, or even send the user to a whole new site, rather like Twitter does (<a href="http://m.twitter.com/">m.twitter.com</a>). However, there&#8217;s a simpler way to do it using some CSS media queries. The advantage of this is that you&#8217;re simply reusing old content and pre-written markup, and only ever using one CSS file.</p>
<p>The first thing you need to do is make sure the HTML link element that points to your main stylesheet does <strong>not</strong> have a <code>media</code> attribute:</p>
<pre><code>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/path/to/style.css&quot; /&gt;</code></pre>
<p>Next, we&#8217;re going to use <a href="http://csswizardry.com/quick-tips/#tip-15" title="Quick Tip on combining CSS media types in one CSS file">Quick Tip #15</a> that I wrote on my Quick Tips page. This means that we can just add our iPhone styles directly onto the end of the main stylesheet, and inherit all the styles set for desktop viewing:</p>
<pre><code><span class="code-comment">/*--- Main CSS here ---*/</span>

<span class="code-comment">/*------------------------------------*\
	IPHONE
\*------------------------------------*/</span>
@media screen and (max-device-width: 480px){
<span class="code-comment">/*--- iPhone only CSS here ---*/</span>
}
</code></pre>
<p>Now any CSS before the media query will be used across all platforms, but anything between the query will be used by any screen media with a maximum screen size of 480px (i.e. an iPhone).</p>
<h3>Things to remember</h3>
<p>There are a few key things to remember when developing CSS for the iPhone:</p>
<ul>
<li>Avoid explicit absolute widths&mdash;where possible you should use percentage widths.</li>
<li>Linearise everything&mdash;where possible, remove all floats. We want no content side-by-side unnecessarily.</li>
</ul>
<p>The first thing to do is to set the <code>-webkit</code> proprietary CSS <code>-webkit-text-size-adjust</code> on the body which will resize the text for you, meaning you shouldn&#8217;t have to touch any font sizes yourself. Also, if your body copy is set in a sans font such as Arial, now is your chance to use some Helvetica&mdash;for normal sites, Helvetica should not be used as body copy as it renders hideously on a PC. Take advantage of the fact that you can guarantee its presence and quality on an iPhone. Change your <code>font-family</code>:</p>
<pre><code><span class="code-comment">/*--- Main CSS here ---*/</span>

<span class="code-comment">/*------------------------------------*\
	IPHONE
\*------------------------------------*/</span>
@media screen and (max-device-width: 480px){
body{
  -webkit-text-size-adjust:none;
  font-family:Helvetica, Arial, Verdana, sans-serif;
  padding:5px;
}
}
</code></pre>
<p>Above, I also added a small padding to make sure nothing touches the edge of the browser. All wrapper and content <code>div</code>s from here on in should be set to <code>width:100%;</code> making them the whole width of the screen, minus 10px.</p>
<h3>Structure</h3>
<p>Now, as all layouts differ I am going to assume a similar one to mine, a simple two column set up with a logo and menu in the header. If your layout is different I am sure you can quite easily retrofit it. As I mentioned before, remove all stylistic <code>float</code>s and set all widths to <code>100%</code>. If you are using <code>div</code>s sensibly (i.e. for large bodies of content and not for nav items) this code should see you right for linearising the content:</p>
<pre><code>@media screen and (max-device-width: 480px){
body{...}
div{
  clear:both!important;
  display:block!important;
  width:100%!important;
  float:none!important;
  margin:0!important;
  padding:0!important;
}
}
</code></pre>
<p>That will force all <code>div</code>s to rest one on top of the other, full width and in order. You have begun linearising all your content.</p>
<h3>The navigation</h3>
<p>If you have a navigation menu in which all the items are floated and made horizontal, insert the following:</p>
<pre><code>@media screen and (max-device-width: 480px){
body{...}
div{...}
#nav,#nav li{
  float:none!important;
  clear:both!important;
  margin:0 0 20px 0!important;
  display:block;
  padding:0;
  text-align:left!important;
  width:100%;
}
#nav{
  border:1px solid #ccc;
  padding:5px;
  -webkit-border-radius:5px;
}
#nav li{
  margin:0!important;
}
#nav li a{
  display:block;
}
}
</code></pre>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/01/iphone-02.jpg" alt="A screenshot of the CSS Wizardry navigation menu on an iPhone" width="320" height="142" class="left" /></p>
<p>This then will give you a vertical navigation menu which has a 100% width and the actual links themselves have a larger hit area (applied via <code>display:block;</code>), meaning that it&#8217;s prominent at the top of each page and easier for users to select single items.</p>
<h3>Images</h3>
<p>As images inherently have a set pixel width (i.e. their own width) there is a high chance that they will break out of the wrapper area (as a lot of images will be above 480px wide). To combat this simply add the following:</p>
<pre><code>@media screen and (max-device-width: 480px){
body{...}
div{...}
#nav,#nav li{...}
img{
  max-width:100%;
  height:auto;
}
}
</code></pre>
<p>Other than elements very specific to my site, that is pretty much <a href="/wp-content/themes/default/style.css" title="Link to the CSS Wizardry CSS file">all the CSS I use to quickly size and linearise my content</a>. Any elements specific to your own site will obviously need considering on a case-by-case basis, but if you remember to not set absolute widths and to always linearise your content then it should be a doddle. Oh and it&#8217;s a great time to use some guaranteed <a href="/css3/" title="A CSS3 and Progressive Enhancement examples page I created">CSS3</a>.</p>
<p>View <a href="http://csswizardry.com/wp-content/uploads/2010/01/iphone-03.jpg" title="Link to a 250KB JPG file">a screenshot of an entire page of CSS Wizardry</a> on an iPhone.</p>
<p>Do you have an iPhone version of your site? Have you any more tips you&#8217;d like to add? Please do so in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/iphone-css-tips-for-building-iphone-websites/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>The three types of dash</title>
		<link>http://csswizardry.com/2010/01/the-three-types-of-dash/</link>
		<comments>http://csswizardry.com/2010/01/the-three-types-of-dash/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:07:43 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=477</guid>
		<description><![CDATA[Unbeknown to many, there are three main many types of dash, and one of the most common typographical mistakes is to use the wrong dash for the wrong job. There are actually three several different types of dash and each have their own uses. The &#8216;dash&#8217; you see on your keyboard is actually a hyphen [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>U</span>nbeknown</span> to many, there are <del>three main</del> <ins>many</ins> types of dash, and one of the most common typographical mistakes is to use the wrong dash for the wrong job. There are actually <del>three</del> <ins>several</ins> different types of dash and each have their own uses. The &#8216;dash&#8217; you see on your keyboard is actually a hyphen which is used as a &#8216;catch all&#8217; glyph which is used for several purposes. The only reason for this is that there&#8217;s just not enough room on a keyboard for so many different dashes.</p>
<p><span id="more-477"></span></p>
<h3>The em dash &mdash;</h3>
<p>The em dash (<code>&amp;mdash;</code>)&mdash;so named because it is the width of a capital &lsquo;M&rsquo;&mdash;is used to delimit a separate clause in a sentence&mdash;rather like this&mdash;or similar sub-clause structures. Often used in its place however is the hyphen (-). Looking at the two side by side the difference is quite clear:</p>
<h4>Proper em dashes:</h4>
<p class="outdent"><q>The em dash (&mdash;), or m dash, m-rule, etc., often demarcates a parenthetical thought&mdash;like this one&mdash;or some similar interpolation.</q></p>
<h4>Improper hyphens:</h4>
<p class="outdent"><q>The em dash (&mdash;), or m dash, m-rule, etc., often demarcates a parenthetical thought &#8211; like this one &#8211; or some similar interpolation.</q></p>
<h4 id="dashes-spaces">Spaces around em dashes</h4>
<p>The proper setting of em dashes seems somewhat unclear. The ideal way to set them is with hair spaces (<code>&amp;#8202;</code>) either side&#8202;&mdash;&#8202;like this. However, <abbr title="Internet Explorer 6">IE6</abbr> doesn&rsquo;t support the hair space leaving the options of either fully spaced &mdash; like this, or unspaced&mdash;like this.</p>
<table>
<caption>Various means of spacing em dashes</caption>
<thead>
<tr>
<th>Fully Spaced</th>
<th>Hair Spaced</th>
<th>Un Spaced</th>
</tr>
</thead>
<tbody>
<tr>
<td>
							This &mdash; is an em &mdash; dash.
						</td>
<td>
							This&#8202;&mdash;&#8202;is an em&#8202;&mdash;&#8202;dash.
						</td>
<td>
							This&mdash;is an em&mdash;dash.
						</td>
</tr>
</tbody>
</table>
<h3 id="en-dash">The en dash &ndash;</h3>
<p>The en dash (<code>&amp;ndash;</code>)&mdash;so named because it is half the width of a capital &lsquo;M&rsquo; (an &lsquo;n&rsquo;)&mdash;has altogether different uses to the em dash. The en dash is used in ranges, for example:</p>
<ul>
<li>6 &ndash; 10 years</li>
<li>July 10 &ndash; August 1 2009</li>
<li><abbr title="pages">pp.</abbr> 40&ndash;42</li>
<li><abbr title="sections">&sect;&sect;</abbr> 12&ndash;13</li>
</ul>
<p>Read <a href="http://en.wikipedia.org/wiki/Dash#En_dash" title="The en dash on Wikipedia">more specific guidelines</a> on Wikipedia.</p>
<h3 id="hyphen">The hyphen</h3>
<p>The purpose of the hyphen (-) is to join two words&mdash;for example &lsquo;front-end&rsquo;&mdash;and to separate syllables when splitting a long word over two lines. As previously mentioned, the hyphen is often misused in place of both the above.</p>
<h4>The minus</h4>
<p>There is also a separate dash for the minus symbol. The proper entity for a minus symbol is simply <code>&amp;minus;</code>.</p>
<h3><ins>More reading</ins></h3>
<p><ins>A reader of the old CSS Wizardry left me with a link to <a href="http://garyjones.co.uk/development/hyphens" title="Using the correct hyphen">one of his own articles</a> covering a few <em>further</em> variations of each.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/the-three-types-of-dash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The importance of proper punctuation</title>
		<link>http://csswizardry.com/2010/01/the-importance-of-proper-punctuation/</link>
		<comments>http://csswizardry.com/2010/01/the-importance-of-proper-punctuation/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 11:44:38 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Writing]]></category>
		<category><![CDATA[punctuation]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=462</guid>
		<description><![CDATA[This is a short (and cheeky) post on the necessity of using proper punctuation&#8212;particularly the hyphen&#8212;and how it can completely alter the meaning of your sentence, often with ill effect. This morning, for one reason or another, I was reminded of a conversation I had with @nofunnyname last week on the subject of him buying [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>T</span>his</span> is a short (and cheeky) post on the necessity of using proper punctuation&mdash;particularly the hyphen&mdash;and how it can completely alter the meaning of your sentence, often with ill effect. This morning, for one reason or another, I was reminded of a conversation I had with <a href="http://twitter.com/nofunnyname" title="Dan Metcalfe on Twitter">@nofunnyname</a> last week on the subject of him buying a car. He said:</p>
<blockquote><p>&ldquo;I need to get an old ass banger.&rdquo;</p>
</blockquote>
<p>So, is that <q>&#8216;old-ass banger&#8217;</q>, or <q>&#8216;old ass-banger&#8217;</q>? You decide ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/the-importance-of-proper-punctuation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A reconsideration&#8212;in defence of &lt;b&gt; and &lt;i&gt; (or: people fear what they don&#8217;t understand)</title>
		<link>http://csswizardry.com/2010/01/a-reconsiderationin-defence-of-b-and-i-or-people-fear-what-they-dont-understand/</link>
		<comments>http://csswizardry.com/2010/01/a-reconsiderationin-defence-of-b-and-i-or-people-fear-what-they-dont-understand/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 23:06:10 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=306</guid>
		<description><![CDATA[The other day, I got to thinking about the HTML elements &#60;b&#62; and &#60;i&#62;, and wondered if they were still viably usable in production code. I&#8217;ve personally never used them before but I was aware that they existed and were still very much valid XHTML markup (even in the Strict DOCTYPE!). Wondering whether I&#8217;d avoided [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>T</span>he</span> other day, I got to thinking about the HTML elements <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code>, and wondered if they were still <em>viably</em> usable in production code. I&#8217;ve personally never used them before but I was aware that they existed and were still very much valid XHTML markup (even in the Strict <code>DOCTYPE!</code>). Wondering whether I&#8217;d avoided two elements for three years unnecessarily, I did some digging.</p>
<h2>What the facts state</h2>
<p><code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> <em>are</em> still valid, and as XHTML is just an XML serialisation of HTML, pretty much all the elements apparent in the HTML spec are true of the XHTML spec too&mdash;it is, pretty much, just the way in which these elements are written that makes them different in XHTML.</p>
<h2>Twitter</h2>
<p>With the help of <a href="http://twitter.com/smashingmag" title="Smashing Magazine on Twitter">@smashingmag</a> I turned to <a href="http://twitter.com/csswizardry">Twitter</a> and my knowledgeable followers and asked the question:</p>
<blockquote><p>&ldquo;Using &lt;i&gt; and &lt;b&gt; in (valid) XHTML (strict)… your thoughts on this would be much appreciated. #upcomingBlogPost Cheers all!&rdquo; <strong><a href="http://twitter.com/csswizardry" title="Harry Roberts on Twitter">@csswizardry</a></strong></p>
</blockquote>
<p><span id="more-306"></span></p>
<p>Most of the answers I got said petty much the same thing: use <code>strong</code> and <code>em</code> &#8230; <code>b</code> and <code>i</code> are deprecated. While this is largely true, there are some myths that need dispelling.</p>
<ul>
<li><code>strong</code> and <code>em</code> are <em>not</em> the same as bold and italics. strong is strong emphasis and em is emphasis. <strong>It is purely through convention that these two elements happen to adopt either bold or italicised appearances.</strong></li>
<li><code>b</code> and <code>i</code> are <em>not</em> deprecated in any way in HTML or XHTML. <strong>They are still in existence, still valid and still (in the right places) usable.</strong></li>
</ul>
<h3>Some replies</h3>
<p>A few choice replies I received which are, on the whole, representative of everyone&#8217;s thoughts:</p>
<blockquote><p>&ldquo;strong and em make more sense, especially when taking screen readers into account. <strong><a href="http://twitter.com/CreativeNotice" title="CreativeNotice on Twitter">@CreativeNotice</a></strong></p>
</blockquote>
<p>Or so you&#8217;d think, <a href="#fallacy">see below&#8230;</a></p>
<div class="hr">
<hr /></div>
<blockquote><p>&ldquo;I prefer &lt;strong&gt; &lt;/em&gt; because of semantics . You want to put emphasis, not just make text italic.&rdquo; <strong><a href="http://twitter.com/wehelpdesign" title="WeHelpDesign on Twitter">@WeHelpDesign</a></strong></p>
</blockquote>
<p>True, if you <em>do</em> just want emphasis that is&#8230;</p>
<div class="hr">
<hr /></div>
<blockquote><p>&ldquo;Using &lt;i&gt; and &lt;b&gt; is just fine if it&#8217;s for visual bling without real semantic background.&rdquo; <strong><a href="http://twitter.com/levito" title="Veit Lehmann on Twitter">@levito</a></strong></p>
</blockquote>
<p>Ah, this is more like it!</p>
<div class="hr">
<hr /></div>
<blockquote><p>&ldquo;&lt;b&gt; and &lt;i&gt; tags describe presentation, not structural semantics. Rather style &lt;em&gt; and &lt;strong&gt; tags.&rdquo; <strong><a href="http://twitter.com/hornergraphic" title="Stephen Horner on Twitter">@hornergraphic</a></strong></p>
</blockquote>
<p>A view that is seemingly shared by almost everyone else who responded.</p>
<div class="hr">
<hr /></div>
<h3>What about strong and em?</h3>
<p>The vast majority of people who replied were in favour of <code>strong</code> and <code>em</code> over <code>b</code> and <code>i</code>. Presuming all respondents were assuming the question was &#8216;What are your thoughts on using <code>b</code> and <code>i</code> to represent strong emphasis and emphasis, and thus replace <code>strong</code> and <code>em</code>?&#8217; then they&#8217;d have all been spot on correct. However, <code>b</code> and <code>i</code> and <code>strong</code> and <code>em</code> are  totally separate things. <code>b</code> and <code>i</code> assume no semantic value, meaning literally bold and italic respectively. <code>strong</code> and <code>em</code> however have nothing to do with bold or italics. As previously mentioned, it is through convention only that the default styling for each is so.</p>
<p><code>strong</code> and <code>em</code> are &lsquo;spoken word&rsquo; type elements, where they represent a change in tone only. This means that their styling is in no way linked to their naming, it is just that us, as people, are familiar with italicised prose sounding more stressed&mdash;or emphasised&mdash;than surrounding text. This is where the importance of aforementioned semantics and screenreaders come in. Or is it&#8230;?</p>
<h4 id="fallacy">The screenreader fallacy</h4>
<p class="marginalia">Screenreaders <em>don&#8217;t</em> use <code>strong</code> and <code>em</code>!</p>
<p>The common belief is that <code>strong</code> and <code>em</code>&#8217;s semantic meaning is used by screenreaders to alter tonality when reading content aloud, thus letting the user know that the copy is in fact meant to be understood in a different manner to any neighbouring text. This was something I too believed until the wonderfully knowledgeable <a href="http://twitter.com/pekingspring">@pekingspring</a> pointed me toward <a href="http://www.paciellogroup.com/blog/?p=41" title="An article covering the way screenreaders handle emphasised text">this article</a> by <a href="http://twitter.com/stevefaulkner">@stevefaulkner</a>&mdash;it turns out screenreaders <em>don&#8217;t</em> use <code>strong</code> and <code>em</code> to alter tonality!</p>
<p>This means that screenreaders see no semantic value in the <code>strong</code> and <code>em</code> element. However, they should be used <em>unconditionally</em> where a change in tone is implied, whether a screenreader will understand this or not.</p>
<h3>Where to use &lt;b&gt; and &lt;i&gt; then?</h3>
<p>One of my first thoughts was where to use these elements if indeed they are still usable. My initial idea was the use of <code>i</code> for markup up things that have to be italicised but the italics aren&#8217;t indicative of any tone. To quote the <cite>Penguin Guide to Punctuation</cite>:</p>
<blockquote><p>&ldquo;Another use of italics &#8230; is to cite titles of complete works&#8230;&rdquo;</p>
</blockquote>
<p>Initially I thought this was the ideal use for the <code>i</code> element&mdash;something that had to be in italics, yet implied no tone of voice. It was such a good fit! However, <a href="http://twitter.com/pekingspring">@pekingspring</a> came to my aid again and reminded me that the <code>cite</code> element is for this exact purpose. That was that idea gone.</p>
<p>Another possible usage for the <code>i</code> element was gleaned from the <cite><a href="http://typographyapp.com/">Typography Manual</a></cite> iPhone app, which states:</p>
<blockquote><p>&ldquo;Italics should be used for single letters in a sentence referred to as letters. [for] example &lsquo;The letter <i>j</i> appears too large.&rsquo;&rdquo;</p>
</blockquote>
<p>An idea I had for using <code>b</code> was somewhat linked to the <code>cite</code> element anyway. A common mistake is to markup the &#8216;author&#8217; of a quote in <code>cite</code> tags. This is of course incorrect, but what <em>do</em> you use? It&#8217;s not really a paragraph, so what is it? I did consider the <code>b</code> element for this, but I feel that such a piece of information does need a more semantic element to represent it.</p>
<p>Friend and colleague <a href="http://twitter.com/simonwiffen">@simonwiffen</a> has a very nicely written example usage for each, which I personally think are spot on. The following chunk of text is lifted directly from an internal document written by <a href="http://twitter.com/simonwiffen">@simonwiffen</a>:</p>
<div class="hr">
<hr /></div>
<p><strong>1.4.3 Strong, emphasis, bold and italic</strong></p>
<p><code>&lt;strong&gt;</code> (strong emphasis) and <code>&lt;em&gt;</code> (emphasis) should be used as opposed to <code>&lt;b&gt;</code> (bold) and <code>&lt;i&gt;</code> (italic) unless the bold or italic is required without any semantic context (for example in a product name).</p>
<p><strong>Examples</strong></p>
<p>Remember <strong>you must</strong> check this box</p>
<pre><code>&lt;p&gt;Remember &lt;strong&gt;you must&lt;/strong&gt; check this box.&lt;/p&gt;</code></pre>
<p>You should <em>really</em> try to validate your pages</p>
<pre><code>&lt;p&gt;You should &lt;em&gt;really&lt;/em&gt; try to validate your pages&lt;/p&gt;</code></pre>
<p>Read more about <b>Splash<i>down</i>!&trade;</b> below</p>
<pre><code>&lt;p&gt;Read more about &lt;b&gt;Splash&lt;i&gt;down&lt;/i&gt;!&trade;&lt;/b&gt; below&lt;/p&gt;</code></pre>
<div class="hr">
<hr /></div>
<p>Succinct and, in my opinion, pretty hard to argue with.</p>
<h4>HTML5 has it sussed</h4>
<p class="marginalia">I won&#8217;t be using HTML5 for a long while yet, but that&#8217;s another story altogether&#8230;</p>
<p>Ideally I&#8217;d like to retrofit the HTML5 specification&#8217;s definitions of each for use right now in XHTML, however I&#8217;m not sure I&#8217;d be comfortable going ahead with doing such a thing, coding to one spec whilst picking my favourite bits of another.</p>
<h5>The &lt;b&gt; element in HTML5</h5>
<blockquote><p>&ldquo;The b element represents  a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is boldened.&rdquo;</p>
<p><cite><a href="http://dev.w3.org/html5/spec/Overview.html#the-b-element">HTML5</a></cite></p></blockquote>
<h5>The &lt;i&gt; element in HTML5</h5>
<blockquote><p>&ldquo;The i  element represents  a span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized.&rdquo;</p>
<p><cite><a href="http://dev.w3.org/html5/spec/Overview.html#the-i-element">HTML5</a></cite></p></blockquote>
<h3>A go-between in the meantime?</h3>
<p>There will always be the argument that instead of using <code>b</code> and <code>i</code> you could or should use something like &lt;span class=&quot;italics&quot;&gt; or &lt;span class=&quot;bold&quot;&gt; so as to avoid using insemantic elements, however a class name like that is more insemantic than an in-spec HTML element. Not to mention the fact that a <code>span</code> with a <code>class</code> applied is far more cumbersome than a &#8216;pre-made&#8217; piece of HTML.</p>
<h3>The resolve?</h3>
<p>So which is worse?</p>
<ul>
<li>Using <code>i</code> to mark up emphasised text</li>
<li>Using <code>em</code> to mark up italicised and non-emphasised text</li>
<li>Using <code>i</code> to mark up purely italicised text</li>
<li>Using <code>&lt;span class="italics"&gt;</code> to mark up italicised text</li>
</ul>
<p class="marginalia">Special thanks to the following for help with this article: <a href="http://twitter.com/smashingmag" title="Smashing Magazine on Twitter">@smashingmag</a>, <a href="http://twitter.com/pekingspring">@pekingspring</a>, <a href="http://twitter.com/stevefaulkner">@stevefaulkner</a>, <a href="http://twitter.com/simonwiffen">@simonwiffen</a> and all <a href="http://twitter.com/csswizardry/followers">my Twitter followers</a>.</p>
<p>I think that the fact that <code>b</code> and <code>i</code> are still in the spec, are valid (even in strict) and are being carried over to HTML5 (albeit slightly redefined) indicates that there is still a very real place for them in web development right now. The frequency with which they&#8217;ll be used is slim at best, but they should not be ruled out, and at the very least not misunderstood. I&#8217;m not going to make the leap myself just yet, but they are there, they are usable, and one day I might just use them.</p>
<p>What are you going to do?</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/a-reconsiderationin-defence-of-b-and-i-or-people-fear-what-they-dont-understand/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>A suitable alternative&#8212;on proper use of alt attributes</title>
		<link>http://csswizardry.com/2010/01/a-suitable-alternativeon-proper-use-of-alt-attributes/</link>
		<comments>http://csswizardry.com/2010/01/a-suitable-alternativeon-proper-use-of-alt-attributes/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 16:03:03 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=318</guid>
		<description><![CDATA[Images in HTML come with a mandatory attribute used to textually describe the information displayed visually through the image. The alt attribute (not tag) is used by screenreaders etc to tell users who can&#8217;t view the actual image what it represents. It is also used in any circumstance where images can&#8217;t be loaded (slow connections, [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>I</span>mages</span> in HTML come with a mandatory attribute used to <em>textually</em> describe the information displayed <em>visually</em> through the image. The <code>alt</code> attribute (<a href="http://csswizardry.com/eta" title="A link to a diagram showing the differences between elements, tags and attributes">not tag</a>) is used by screenreaders etc to tell users who can&#8217;t view the actual image what it represents. It is also used in any circumstance where images can&#8217;t be loaded (slow connections, broken URIs etc).</p>
<p><span id="more-318"></span></p>
<h2>When not to use it</h2>
<p class="marginalia">You should never <em>not</em> use an <code>alt</code> attribute, rather leave it empty, thus: <code>alt=""</code></p>
<p>The only time you can really get away with <em>not</em> having a complete <code>alt</code> attribute is if the image holds no context or information that the user needs to be aware of. This is usually the case when the image is purely decorational, though it may be argued that the image should therefore be added through CSS in the spirit of separating style and content. By that token it is fairly safe to say that there should never be an instance in which you leave an <code>alt</code> attribute empty.</p>
<h2>You&#8217;re using it, but not quite right&#8230;</h2>
<p>The next best scenario is that you are using images correctly, for their correct purpose and are using <code>alt</code> attributes, but they don&#8217;t really do as much as they should. A lot of the time I come across images that have less than ideal <code>alt</code> attributes.</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/01/car.jpg" alt="A photograph of an abandoned car" width="640" height="393" class="full" /></p>
<p class="marginalia">Image sourced via Google Images&mdash;original author unknown.</p>
<p>One example might be the above image of a car. This, while technically correct, is not ideal: <code>&lt;img src="/img/car.jpg" alt="Car" /&gt;</code>. All this tells the user is &#8216;Car&#8217;. It doesn&#8217;t say whether it&#8217;s a picture with the word car in it, or whether it&#8217;s a picture of a car. A much better <code>alt</code> attribute would be <code>alt="A photograph of an abandoned car"</code> (as used in my code).</p>
<h3>Other poor uses</h3>
<p>Another real-world example of poor <code>alt</code> attribute usage is actually on <a href="http://www.cnn.com/">CNN&#8217;s website</a>. On their home page today (26 January, 2010) they have a series of headlines with accompanying images. The code for such a pairing looks like this:</p>
<pre><code>&lt;img height="68" border="0" width="120" alt="Haiti's swanky club &rarr;
now home to misery" src="http://i.cdn.turner.com/cnn/2010/WORLD/ &rarr;
americas/01/26/haiti.camp/tzvids.haiti.aid.cnn.jpg"&gt; &rarr;
&hellip; Haiti's swanky club now home to misery</code></pre>
<p>This is wrong on two counts:</p>
<ol>
<li>A screenreader will read out to the user <q>Haiti&#8217;s swanky club now home to misery &hellip; Haiti&#8217;s swanky club now home to misery</q>. Every image/headline pairing on the page is laid out like this, meaning in every instance a user using a screenreader will hear the headline twice. This will surely soon get annoying.</li>
<li>Secondly, the image was actually of earthquake survivors holding a large bag, nothing to do with clubs and, unfortunately, far from swanky.</li>
</ol>
<h2>Using the attribute properly</h2>
<p>On the <a href="http://www.bbc.co.uk/">BBC&#8217;s home page</a> however (on the same date) they are using <code>alt</code> attributes perfectly. They have an image of a woman wearing a veil, alongside the article&#8217;s headline <q>France report back face veil ban</q>. The image&#8217;s <code>alt</code> attribute: <code>alt="A woman wears a full-length veil in Lyon, 25 January"</code>.</p>
<h2>The biggest no-no of all</h2>
<p>One thing which consistently winds me up is the ridiculously bad practice of stuffing <code>alt</code> attributes with keywords. <code>alt</code> attributes are an accessibility feature, end of. They are <em>not</em> a way of slipping in keywords out of sight, and any attempt to do so is irresponsible and incredibly bad practice. The only time &#8216;keywords&#8217; may be validly placed in <code>alt</code> attributes is if it&#8217;s explicitly related to the image; for example: <code>&lt;img src="/img/product.jpg" alt="A photograph of Mike's Carpets' ProClean&trade; carpet cleaner" /&gt;</code>.</p>
<h2>How to do it properly</h2>
<p>Writing proper <code>alt</code> text is incredibly simple, yet a little more time consuming than the &#8216;Car&#8217; cop-out. All you need to do is write out in full exactly what the image shows. If it&#8217;s an elephant giving a donkey a piggy-back don&#8217;t be lazy and use <code>alt="Elephant and a donkey"</code>. Instead, write out <code>alt="A photograph of an African elephant giving a donkey a piggy back across a swamp"</code>.</p>
<p>Also, for any pages that use similar images repeatedly but are slightly different to one another, make sure your alt attributes reflect these differences. A good example would be <a href="http://csswizardry.com/portfolio/">my portfolio page</a>. Instead of using <code>alt="Screenshot"</code> over and over again I used text like <code>alt="Screenshot of Suzanna Haworth’s website"</code> and <code>alt="Screenshot of RAAMaudio UK Ltd."</code> etc.</p>
<p>This is one of the most basic aspects of web development, but one that too many people are still getting wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/a-suitable-alternativeon-proper-use-of-alt-attributes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pastures new&#8212;from Sense to Venturelab</title>
		<link>http://csswizardry.com/2010/01/pastures-newfrom-sense-to-venturelab/</link>
		<comments>http://csswizardry.com/2010/01/pastures-newfrom-sense-to-venturelab/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 09:42:59 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=245</guid>
		<description><![CDATA[From mid July, 2008, I was employed by the fantastic Sense Internet as a web designer/developer. It was amazing, going from a nice small agency to a much larger entity was a massive but incredible leap for both my career and me personally. However, a mere 18 months on, I find myself somewhere else&#8212;after a [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>F</span>rom</span> mid July, 2008, I was employed by the fantastic <a href="http://sense.co.uk/">Sense Internet</a> as a web designer/developer. It was amazing, going from a nice small agency to a much larger entity was a massive but incredible leap for both my career and me personally. However, a mere 18 months on, I find myself somewhere else&mdash;after a year and a half of working with wonderfully talented and amazing people on some superb projects, I tore myself away.</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/01/pastures-new.jpg" alt="A black and white photo of a gate leading into a field&mdash;by Simon Wiffen" width="640" height="426" class="full" /></p>
<p class="marginalia">Photo by <a href="http://simonwiffen.co.uk/">Simon Wiffen</a>.</p>
<h2>Sense Internet</h2>
<p>I applied the job at Sense when I was 17. My interviewer was my soon to be boss and Creative Director <a href="http://twitter.com/SloMoFoFatTo" title="Tony Jacobs on Twitter">Tony Jacobs</a>. Just from seeing the company and meeting Tony I knew this was where I wanted to work.</p>
<p><span id="more-245"></span></p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/01/suze.jpg" alt="Photograph of Suzanna Haworth" width="210" height="316" class="left polaroid skewed" /></p>
<p>After starting at Sense on 14 July, 2008, I got to meet some amazing people, who were excellent at their jobs, great to get on with and an all round top team. I worked on a range of projects of varying sizes with different roles and responsibilities. I was allowed to exercise my skills, and learn from others. I could voice my opinion in as much as I listened to what others had to offer. It was an excellent creative and skilled environment.</p>
<p>One of Sense&#8217;s greatest assets is its people and it provided me with friends, colleagues, and above all my beautiful girlfriend Suzanna. We were both fortunate enough to work with people who became good friends to the both of us. Working with someone you&#8217;re in a relationship with, some would say, is inadvisable, but I loved every minute of it. It was something that made my next decision all the more difficult&#8230;</p>
<h2>The decision</h2>
<p>After, for one reason or another, losing friends, colleagues and mentors from Sense things began feeling a little different. It&#8217;s more than fair to say Sense was still an amazing company, and probably the best I <del datetime="2010-01-21T17:19:05+00:00">have</del> will ever work<del datetime="2010-01-21T17:19:05+00:00">ed</del> for, however things just didn&#8217;t <em>feel</em> the same. I had no views to leaving Sense at all, I was still happy there, until I was granted an opportunity to work once more with the massively talented <a href="http://twitter.com/nofunnyname" title="Dan Metcalfe on Twitter">Dan Metcalfe</a>, and my previous &#8216;mentor&#8217;, <a href="http://twitter.com/simonwiffen" title="Simon Wiffen on Twitter">Simon Wiffen</a>.</p>
<p>That opportunity was to work for entrepreneur <a href="http://whitstongroup.com/" title="The Whitston Group">Justin Whitston</a> at his new startup, <a href="http://www.venturelab.co.uk/">Venturelab</a>. After meeting Justin and hearing his ideas, as well as his business plan and impressive portfolio, I was loving the idea of a fresh new challenge. Over the next month I had some really big decisions to make.</p>
<p>I could stay at Sense where, owing to their position, I had the chance to shape a team and become a senior developer. I would stay with friends in a job I was more than happy with, working with and for some great people. Or, I could take a risk, up and leave and work with two friends for a brand new company building websites for entrepreneurs and, whereas Sense worked with large household names, on unknown projects and clients. It was traditional agency work vs. a chance to work in a more fast paced business centred environment.</p>
<h2>Venturelab</h2>
<p>After much deliberation I decided to head to Venturelab. I wasn&#8217;t really ready to leave Sense, but opportunities like this don&#8217;t come around that often. It was something I had to do now, while I could. Being 19 I can afford to take career risks right now that maybe I couldn&#8217;t later on.</p>
<p>So, as of 11 January, 2010, I was employed by Venturelab. I miss Sense and all its wonderful characters and working environment a <em>lot</em>, but the idea of new challenges is exciting to me. I now have the opportunity to break away from your &#8216;typical&#8217; web work and a chance to help businesses really grow. Plus the technical aspects of being a web developer at Venturelab is amazing&mdash;I have submitted and had accepted a proposal for the dev team to adopt a progressive enhancement approach across the board, using CSS3 as standard on all builds.</p>
<p class="marginalia"><strong><a href="http://twitter.com/csswizardry/sense/members" title="Sense list on Twitter">Sense people</a>:</strong> <a href="http://twitter.com/littlefair">Amy Littlefair</a>, <a href="http://twitter.com/simonwiffen">Simon Wiffen</a>, <a href="http://twitter.com/mtarbit">Matt Tarbit</a>, <a href="http://twitter.com/mrben_">Ben Tappin</a>, <a href="http://twitter.com/1stvamp">Wes Mason</a>, <a href="http://twitter.com/nofunnyname">Dan Metcalfe</a>, <a href="http://twitter.com/high_havoc">Connor Wilkinson</a>, <a href="http://twitter.com/phoenix_rises">Jonny Stirling</a>, <a href="http://twitter.com/richardharwood">Richard Harwood</a>, <a href="http://twitter.com/markmakak">Mark Barrett</a>, <a href="http://twitter.com/whyleycat">Gemma Lawson</a>, <a href="http://twitter.com/iamgaz">Gaz Battersby</a>, <a href="http://twitter.com/VIPickering">Vince Pickering</a>, <a href="http://twitter.com/naffoff">Andy Mason</a>, <a href="http://twitter.com/RobFarnell">Rob Farnell</a>, <a href="http://twitter.com/Thessilian">George Kamsika</a>, <a href="http://twitter.com/eightbitikon">Darren Armstrong</a>, <a href="http://twitter.com/suzehaworth">Suzanna Haworth</a>, <a href="http://twitter.com/AidanCook">Aidan Cook</a>, <a href="http://twitter.com/dinomalone">Paul Allen</a>, <a href="http://twitter.com/punch_n_pie">Dan Bentley</a>, <a href="http://twitter.com/SloMoFoFatTo">Tony Jacobs</a>, <a href="http://twitter.com/_yoitsro">Ro Ramtohul</a> (sorry if I missed anyone).</p>
<h2>Final word</h2>
<p>Working at Sense was the most amazing experience I&#8217;ve ever had. The work, the people, the company, everything. I do almost feel like I wasn&#8217;t ready to leave, but Venturelab was an opportunity that I couldn&#8217;t pass up on&mdash;the new environment, the chance to work with Si and Dan once more and an opportunity for more varied responsibilities.</p>
<p>I&#8217;d like to thank Sense; the people I met, the opportunity I was given, their faith in a 17 year old developer and the amazing environment in which they &#8216;employ&#8217; their team (I use the term employ lightly, as Sense never felt like a normal job). It has been an absolutely fantastic time&mdash;with too many good times to even try and remember&mdash;and I hope we cross paths again sometime in the future.</p>
<p>To Aidan, Sense, and everyone there; thank you.<br /><em>Harry</em></p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/pastures-newfrom-sense-to-venturelab/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Customer service&#8212;a company&#8217;s biggest asset</title>
		<link>http://csswizardry.com/2010/01/customer-servicea-companys-biggest-asset/</link>
		<comments>http://csswizardry.com/2010/01/customer-servicea-companys-biggest-asset/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 21:38:40 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=104</guid>
		<description><![CDATA[Recently, when buying products or dealing with companies, I have been noticing something, and its profound effects on me&#8212;customer service. You can deal with a business and get exactly what you&#8217;re after, but it is in that process that some companies can really shine beyond others, and that some can really leave a bad taste [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>R</span></span>ecently, when buying products or dealing with companies, I have been noticing something, and its profound effects on me&mdash;<em>customer service</em>. You can deal with a business and get exactly what you&#8217;re after, but it is in that process that some companies can really shine beyond others, and that some can really leave a bad taste in your mouth&#8230;</p>
<p><span id="more-104"></span></p>
<h2>The good</h2>
<p>It&#8217;s nice to be able to say that lately I&#8217;ve been noticing an <em>increase</em> in good customer service rather than bad. Instead of boring you with reams of storytelling and recounts, I&#8217;ll just give a list and a few points on why I enjoyed dealing with each:</p>
<ul>
<li><strong><a href="http://moo.com/" title="Moo printing">Moo</a>:</strong> I used Moo&#8217;s online system to make <a href="http://csswizardry.com/2010/01/moo-business-cardsmost-impressive/" title="Review of my Moo business cards">my new business cards</a>. They quality was amazing, the delivery was speedy, the process was smooth and the company is great. I&#8217;d definitely recommend them.</li>
<li><strong><a href="http://www.tampopo.co.uk/" title="Tampopo restaurant">Tampopo</a>:</strong> Suze and I headed to Tampopo yesterday for some lunch. If you live near a Tampopo and have never been, I urge you to go. The food is outstanding, the service is quick and the staff are extremely friendly.</li>
<li><strong><a href="http://labottegamilanese.co.uk/">La Bottega Milanese</a>:</strong> This is a tiny little coffee shop that has recently opened by my house. It&#8217;s not a franchise or a chain, it&#8217;s one guy who has opened up a lovely little shop. The coffee was excellent, he was extremely friendly, the shop was nice and it was just a more enjoyable experience than your typical Starbucks type coffee.</li>
<li><strong><a href="http://www.northbar.com/">North Bar</a>:</strong> North Bar is a gorgeous little bar in the centre of Leeds, and a personal favourite of mine. The beers there are out of this world and the service is always superb. If you like world beers, you&#8217;ll love North Bar.</li>
</ul>
<h2>The bad</h2>
<p>Unfortunately there is a flip-side. There are places where the service is not that good.</p>
<ul>
<li><strong><a href="http://www.pcworld.co.uk/">PC World</a>:</strong> Just after Christmas I bought myself a Dell Inspiron Netbook from PC World. <del datetime="2010-01-10T21:13:41+00:00">I</del> <ins datetime="2010-01-10T21:13:41+00:00">Suze</ins> called up the night before to reserve one black Netbook at the online price of £249. We arrived at the store the next day to find they&#8217;d reserved two red ones at £279. When we mentioned this they seemed to think it was our fault. &#8216;It says here you wanted red. It says here you want two. You don&#8217;t want to pay for extra security?!&#8217;</li>
<li><strong><a href="http://oportobar.co.uk/" title="Oporto bar Leeds">Oporto</a>, <a href="http://tinyurl.com/y9fvryz" title="Jake's Bar Leeds">Jake&#8217;s Bar</a> and <a href="http://www.barroombar.com/wherewelive/index.php?view=bar&#038;display=leeds" title="Bar Room Bar Leeds">Bar Room Bar</a>:</strong> This might just be &#8216;one of those things&#8217; but anyone <a href="http://twitter.com/csswizardry" title="Me on Twitter">following me</a> on <a href="http://twitter.com/csswizardry/status/7574973304" title="A tweet I made at the time">Twitter</a> will know that this got me absolutely livid. I headed out with a good friend <a href="http://twitter.com/JoeWhitley" title="Joe Whitley on Twitter">Joe Whitley</a> for a few drinks in Leeds only to be turned away from three bars because they weren&#8217;t prepared to let two guys in without any female company. So much for organising a night out with a male friend. Three of the better bars in Leeds, plus my favourite, Oporto, really managed to annoy and alienate me last night&#8230;</li>
</ul>
<h3>In short&#8230;</h3>
<p>So, in short, the products of all the above are completely acceptable, and worth the amount you pay for them. What made all the difference however is the non-monetary value added (or subtracted) through customer service. It&#8217;s something all businesses should definitely try and focus on more.</p>
<p>Any stories of good or bad customer services yourselves?</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/customer-servicea-companys-biggest-asset/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
