HTML5 Development Center

Developed for you in part by
 
658-html5-aroma

The New Sensory Elements Coming to HTML5

By | | CSS | CSS3 | HTML | HTML5 | Programming

The web is primarily a visual medium with a little audio here and there. HTML5 supports the video and audio tags but our other senses have been shamefully neglected. Until now.

The W3C will shortly announce three new HTML5 elements which support alternative sensory interfaces:

  • <texture> for touch
  • <aroma> for smell, and
  • <flavor> for taste

HTML Usage

The new elements will normally be used as wrappers for other items. For example, you might want to apply a fresh grass odor to an image of a field, e.g.


<aroma fresh="50%" sweet="20%" warm="35%">
	<img src="myfield.jpg" alt="field" />
</aroma>

The categorization attributes will vary depending on the tag, e.g.

  • texture: smoothness, firmness, flaccidity, temperature
  • aroma: sweet, pungent, acrid, fragrant, warm, dry, sour
  • flavor: sweetness, sourness, saltiness

The volume and muted attributes are also supported to indicate the strength of odors and flavors.

However, unless you’re a chemical expert, defining these attributes isn’t easy. For that reason, all tags can use the src and type attributes to point to sensory definition files which contain one or more textures, aromas or flavors, e.g.


<aroma src="cheese.odor" type="stilton">
	<img src="stilton.jpg" alt="stilton cheese" />
</aroma>

Vendors will provide several pre-defined sensory packs within their browsers. However, Chrome’s representation of Roquefort is likely to differ from IE’s; it may be several years before we reach agreed sensory standards. Fortunately, it will be possible to develop your own definition files if compatibility issues arise.

CSS Properties

Textures, odors and flavors can also be applied from CSS. For example, our online cheese shop could link to a Stinking Bishop page:


<a id="stinking" href="stinking-bishop.html">
	<img src="stinking-bishop.jpg" alt="stinking bishop cheese" />
</a>

CSS could apply an appropriate aroma, flavor and texture as the user hovers over or focuses on the link. Sensory definition files or classifications can be used:


a#stinking:hover, a#stinking:focus {
	aroma: url("cheese.odor") stinkingbishop 50%; /* pack, type, volume */
	flavor: url("cheese.taste") stinkingbishop 98%; /* pack, type, volume */
	texture: 25% 30% 20; /* smoothness, hardness, temperature (degrees C) */
}

JavaScript APIs

JavaScript APIs will be available for the new sensory elements. For example, you could mute or change the volume (strength) of a sensory tag, e.g.


var cheese = document.getElementById("stinking");
var c = 0;
Pungent();
function Pungent() {
	cheese.aroma.volume = c + "%";
	c += 5;
	if (c < 100) setTimeout(arguments.callee, 500);
}

This example increases the cheese odor over time. Note that aroma-generating devices are likely to have slower response times than screen output: thorough testing will be required to ensure aromas and flavors don’t clash.

Hardware Support

lick-able mouse wheel

Hardware devices which support these sense elements will be introduced during the next year. One of the first is a multi-sensory mouse by Ollofipra, the Scandinavian PC manufacturer. It uses a patented rubber mesh to change shape, texture and temperature. It also emits a range of smells and the central wheel generates different flavors. The company hopes to add the technology to touch-sensitive monitors so they become lick-able.

Please note that the W3C specifications for the sensory elements are at an early daft stage and implementation changes are inevitable. However, the future looks promising and the tags have potential to revolutionize web interfaces. You should certainly discuss it with your colleagues today.

Learn Responsive Web Design

Join Learnable $29 Includes all SitePoint books

Craig Buckler

Craig is a Director of OptimalWorks, a UK consultancy dedicated to building award-winning websites implementing standards, accessibility, SEO, and best-practice techniques.

More Posts - Website

{ 32 comments }

web $99 April 5, 2012 at 11:00 pm

Thanks for sharing this wonderful article. It helped me gain a lot of info.

My Magnificent Web Page April 2, 2012 at 11:37 pm

thanks for shearing

Craig Buckler April 3, 2012 at 1:14 am

yor welcume

Zick April 2, 2012 at 11:31 pm

We do develop full scale websites in HTML5 but this is something very new to me..
I don’t believe this, as how a device would taste and smell something but really looking forwrd to it..

Zick April 2, 2012 at 11:26 pm

HTML5 includes;

New Elements
New Attributes
Full CSS3 Support
Video and Audio
2D/3D Graphics
Local Storage
Local SQL Database
Web Applications

Jim April 2, 2012 at 11:19 am

“Please note that the W3C specifications for the sensory elements are at an early daft stage…”
I’m not sure if the “daft” was a typo or if it was intended, but it made me laugh anyway.

Craig Buckler April 3, 2012 at 1:12 am

It was intended. Well done for spotting it!

SMW April 2, 2012 at 10:59 am

Couldn’t decide whether this was a typo or a subtle April Fools hint…
“Please note that the W3C specifications for the sensory elements are at an early *daft* stage”

Kise S. April 2, 2012 at 1:38 am

i was about to fall for it until i read the date:@

Matthew P April 1, 2012 at 6:05 pm

Congratulations, you completely got me; I totally forgot the date and was about to thoroughly lament these tag additions in the comments when I saw others mention april fools… Might have embarrassed myself thoroughly if I had happened to read this article before any comments were left.

I was only really skeptical of the flavor tag when reading. The thought of people licking their mobile devices seemed quite absurd, though there has been talk about smell and especially texture being used in UI technology for years so it seemed possible that the W3C was simply rounding out specifications for all 5 senses just to be thorough and without paying any thought to their practical use cases.

Helen Natasha Moore April 2, 2012 at 2:33 am

Yeah, it’s a shame people spoil it immediately. Maybe don’t publish spoiler comments next year, Craig?

Craig Buckler April 2, 2012 at 4:03 am

Perhaps, although there are plenty of tweeters and screen-scraping sites which took it seriously.

Didn’t they spot the “Ollofipra” anagram?!

Stevie D April 5, 2012 at 4:18 am

Oh come on, no-one who’s smart enough to be reading Sitepoint would fall for such an obvious joke … would they?!

(Apart from the spammers who seem to have believed every word of it)

ralph.m April 1, 2012 at 4:33 pm

Browsers that emit smell, hey? Are you saying this is a new thing? As usual, Microsoft is well ahead of the game. Their browsers, email clients and even OSes have been emitting foul odors for many years.

USPaperchaser April 2, 2012 at 3:19 pm

Tell that to their 95% User rate? What is Apples and Linuxes again? BTW, your ‘joke’ was lame.

TehYoyo April 2, 2012 at 3:43 pm

Excellent point you have there! :D

nandida April 1, 2012 at 10:40 am

Ohi craig area you kidding me? :)

CB April 1, 2012 at 9:32 am

Does “favor” for taste imply reciprocation, i.e. your round next?

Craig Buckler April 1, 2012 at 11:50 pm

Whoops! All fixed.

CB April 1, 2012 at 9:31 am

Does for taste imply reciprocation, i.e. your round next?

ralph.m April 1, 2012 at 7:51 am

Typo:
Should be for taste rather than for taste.

Just as with HTML5 offline storage, there are big issues with these new elements—not so much security, by hygiene. Image public computers where people are licking the same hardware device. The implications are terrifying, especially in this age of global pandemics.

magic_al April 1, 2012 at 7:19 am

Nice one. I was telling my girlfriend about this new element when I realized the date :)

Ryan Hellyer April 1, 2012 at 6:19 am

Rumour has it that the iSmell device will be announced at the next Apple keynote.

Helen Natasha Moore April 1, 2012 at 7:38 pm

Now that’s funny :-)

Cristian April 1, 2012 at 3:18 am

One of the best April’s Foll jokes in YEARS!!! :D

Helen Natasha Moore April 1, 2012 at 3:17 am

I don’t think Mike Rapp could have put it better.

Craig Buckler April 1, 2012 at 3:22 am
Helen Natasha Moore April 1, 2012 at 4:15 am

Unforgettable, Craig ;-)
I’ve been looking forward to this all year!

LarryO'Brien April 1, 2012 at 3:07 am

Might I suggest a new element:
for days like this
U got me going for a while there with the cheese

daniel April 1, 2012 at 2:31 am

Same to you MM :))

Heh not really April 1, 2012 at 2:30 am

Nearly fell for it, not really

MM April 1, 2012 at 1:55 am

Have a nice April-fools day yourself too. ;)

Comments on this entry are closed.