Pixelbox

Welcome to Pixelbox. Thursday the 24 of July 2008

Skip to content >>

Microformats hcard HTML

Microformat's are great, and enable us to add even better semantics to our HTML. Using browser plugins we are starting to see the start of what is possible, Operator 0.9.2 offers fantastic functionality in Firefox, and hopefully we will soon see more main stream implementations by the browser manufacturers.

Ideally an IE plugin, but also something on the iPhone or Blackberry will really make this take off in the business arena. Being able to add to your phone book, or quickly get directions to your meeting at the touch of a button is all kinds of awesomeness!

Currently I have my HTML hat on and noticed that one of the main examples on the Microformats website offered little structural semantics via the use of HTML. Admittedly it was a real world example, but I still think there was a lot that could be improved:

From this adapted from http://microformats.org/wiki/hcard#Live_example


<div class="vcard">
  <a class="fn org url" href="http://www.cerosmedia.com/">Ceros Media</a>
  <div class="adr">
    <span class="type">Head Office</span>:
    <div class="street-address">58/62 White Lion St</div>
    <span class="locality">Islington</span>,  
    <abbr class="region" title="London">London</abbr>  
    <span class="postal-code">N19PP</span>
    <div class="country-name">UK</div>
  </div>
  <div class="tel">
   <span class="type">Sales</span> +44 (0)8455211872
  </div>
  <div class="tel">
    <span class="type">Production</span> +44 (0)8455211873
  </div>
  <div class="tel">
    <span class="type">Support</span> +44 (0)8455211874
  </div>
  <div>Email: 
   <span class="email">info@cerosmedia.com</span>
  </div>
</div>

To this:


<dl class="vcard">
	<dt><a class="fn org url" href="http://www.cerosmedia.com/">Ceros Media</a></dt>
	<dd>
		<dl class="adr">
			<dt class="type">Head Office:</dt>
			<dd class="street-address">58/62 White Lion St</dd>
			<dd class="locality">Islington</dd> 
			<dd><abbr class="region" title="London">London</abbr></dd>
			<dd class="postal-code">N19PP</dd>
			<dd class="country-name">UK</dd>
		</dl>
		<dl class="tel">
			<dt class="type">Sales</dt>
			<dd>+44 (0)8455211872</dd>
		</dl>
		<dl class="tel">
			<dt class="type">Production</dt>
			<dd>+44 (0)8455211873</dd>
		</dl>
		<dl class="tel">
			<dt class="type">Support</dt>
			<dd>+44 (0)8455211874</dd>
		</dl>
		<dl>
			<dt>Email</dt>
			<dd class="email">info@cerosmedia.com</dd>
		</dl>
	</dd>
</dl>

I have used definition lists to wrap elements, and therefore been able to replace some spans with corresponding definition titles of definitions. This also gives a much better default styling without CSS, not to mention semantics :)

Meta tags: Development, Random

Binding to private vars in Flex

Using Bindable variables and properties in Flex (Action Script 3) is great, it saves a huge amount of time adding events left right and center. However today I had a problem where I wanted to use a setter for a variable. In order to do this I made it private and used a getter and [...]
Meta tags: AIR, Development, Flex

Changing the default loading screen in Flex

One of the first things you want to do when creating a Flex app is to remove all the default stuff, which makes your app look like everyone else’s. The most obvious default thing in Flex is that loading, progress initilisation bar you get before the application starts. Now before I start there is one thing [...]

Quick update

Fighting my way through this blog’s cobwebs I have finally managed to post!! I have been meaning to post quite a few things recently but keep running out of time, and then moving onto something else… So I thought I would write a quick update as to what’s been keeping me busy! I am currently re-writing [...]

Food for thought

Today we had a long overdue catch up and plan about our product and where we are going. In order to get away from distractions we found a great little venue called, The Old Laundry. The Old Laundry is rented by What If, an innovation company based near Baker street tube. The room we rented for [...]
Meta tags: Development, Technology

Next Page »