Archives for "Web Design: 2006"

Cross Browser Testing Tips

Now that Internet Explorer 7 is starting to gain share of the browser market, cross browser compatibility has become more important than ever. Unfortunately, ensuring your web designs work well on many different browsers, versions and platforms can cause major headaches.

Here are some quick tips on how to test your website design in various browser/version/platform combinations:

1. To install multiple versions of Internet Explorer on a single Windows machine, download this essential multiple-IE utility (approx 10mb) from Tredsoft.

The multiple-IE tool uses some sort of DLL file workaround -- but you don't need to know that. You only need to know that it does exactly what it says on the tin: lets you run multiple standalone versions of Internet Explorer -- from IE3.0 through to IE7 -- simultaneously.

Tip: if you haven't yet upgraded to IE7, do so before running the multiple install tool.

2. For browsers you don't have, use browsershots.org.
This free service lets you submit a URL and generates screenshots.

It won't give you every conceivable combination but will give you many, including Safari for Mac.

If you need to see an IE for mac screenshot, another option is http://www.danvine.com/iecapture/

Tip: It takes a while to get screenshot results, so submit your URLs before you go for lunch; they should be ready when you get back.

3. Use CSS hacks to target specific browsers. While this practice is frowned upon by CSS purists, a few hacks are usually inevitable in the trade-off between elegant code and cross-browser perfection.

Tip: Use hacks that keep your CSS valid, and use as few hacks as possible.

What Makes an Authentic Website?

There are many different types of webmasters but two types I encounter often are:

1. Standards-Obsessed Designers (SODs)
2. Profit-Oriented Webmasters (POWs).

SODs strive for neat, compliant XHTML and best practices in usability and accessibility. Their websites are typically clean, clear and slick.

However, SOD websites can also look cold and generic. Indeed, many so-called "Web 2.0" websites look trendy but soulless.

POWs on the other hand are not concerned about look-and-feel so much as the message they transmit. These are typically bombastic and aggressive - "BEST HOTEL DEALS GUARANTEED", "MAKE $$$ WORKING FROM HOME" etc.

POW-created sites crop up a lot in lucrative areas such as travel. POW travel sites do well in search engine results pages but ultimately look like cheap imitations of market leaders such as Hotels.com or Lastminute.com. (This is because they are all powered by a small number of "white label" booking engines, so they all offer the same "products".)

The worst kind of POW site, from a user perspective, is the "Made for Adsense" site, which lures you in under false pretenses as it were, only to pitch more advertising at you.

That's why authentic websites come as a breath of fresh air on the web. What's an authentic website? Well, if you're an experienced internet user, you'll know one when you see one. But typically they are exhibit the following traits:
  • Clearly made with care and passion
  • A "homemade" look and feel
  • Don't follow latest trends or best practices
  • Few if any advertising messages
  • Engaging, unique content

As a quick example, Algarve Beach Life is a genuinely authentic site I discovered recently when trying to discover things to see and do in the Algarve, Portugal. The site is designed and maintained by one woman, and is clearly a labour of love.

Now, if only there were a way to tag such a site as "authentic" in Google, not just in deli.cio.us...

Five Tips for ReUsable (X)HTML/CSS


I often use the services of freelance web developers, who create documents or templates for projects, which typically I then modify.

I have put a lot of time and effort into selecting great freelancers; each of my suppliers produces excellent, valid HTML or XHTML and CSS. Over time, I have learned to make some key requests up front. When my suppliers apply the following tips, I find it much easier to understand and tinker with their code. I hope you find them useful too:

1. Begin the Document with Last Modified Details

Traditional software development has a developed a complex set of practices and procedures for dealing with version control but web design documents are normally created, revised and shared in a much more casual manner.

I recommend using a short comment at the beginning of each document, noting who last modified it, and when. For example:

/*------------------------------------------------- 
CSS Document for xyz.com
Last Modified by Michael Heraghty on 04 November 06 
---------------------------------------------------*/

This last modified comment is particularly useful in CSS documents, as style sheets get changed more often than individual web pages.

Nevertheless, I like HTML documents to have a last modified comment, though I appreciate that it may not be practical, depending on what editor you use. (With Homesite, it's a snitch. Homesite is my editor of choice for many reasons; its powerful set of "Find and Replace" features among them.)

2. Indent the HTML Code Properly and Consistently

Most web designers worth their salt will nest their HTML, but I reckon that at least 50% of the documents I receive from freelancers aren't properly and consistently indented.

Here is an example of what I consider to be HTML that's not properly indented:

<html>
<head>
<title>Sample document</title>
</head>
<body>
<div id="intro">
	<p>Lorem ipsum dolor sit amet.</p>
	</div>
	<div id="main">
	<ul>
	<li>1st list item</li>
	<li>2nd list item</li>
	</ul>   
	</div>
</body>
</html>

And here's the same HTML, this time with what I consider to be proper indentation:

<html>
	<head>
	<title>Sample document</title>
	</head>
	<body>
		<div id="intro">
		<p> Lorem ipsum dolor sit amet.</p>
		</div>
		<div id="main">
		   <ul>
			   <li>1st list item</li>
			   <li>2nd list item</li>
		   </ul>   
		</div>
	</body>
</html>

I use HTMLTidy, built-in to Homesite, to help with indentation.

Some will argue that the more indentation, the more whitespace and therefore the greater the file size. That's true, but I think the trade-off is worth it. The increase in file size is unlikely to be significant.

3. "Close" div and span Tags Using Comments

Did you notice the comments I added in the previous example?

I hate seeing end-div tags. I have to hunt for the opening div (that can be a real pain where the code hasn't been properly indented, or where divs with the same class occur several times in succession.

To avoid headaches, I request that freelancers put comments right after a closing div or span tag, indicating the name and type of the relevant selector. For example:

<div id="wrapper">
Lorem ipsum dolor sit amet.

	<span class="intro">
	Lorem ipsum dolor sit amet.
	</span>< !-- .intro -->
	
</div>< !-- #wrapper -->

(Note: I had problems displaying comments here, so I had to add a space before the exclamation mark - don't do this in "real" code, or the comment won't be hidden.)

4. Use Breadcrumb-style CSS Selectors

One of the most difficult elements in reverse-engineering someone's code is figuring out where various CSS selectors are used in the HTML document.

I like my designers to get specific, wherever possible, when identifying selectors in documents.

For example, rather than:

.credit{
border: 1px solid #000;
}

I prefer to see:

#footer p.credit{
border: 1px solid #000;
}

Now I know the "credit" class occurs within a paragraph, nested within a footer div. I can "see" the HTML, even though I'm looking at the CSS. I also know that changing the "credit" class will affect the footer of the document, but no-where else.

My CSS editor of choice (Top Style Pro) groups selectors according to inheritances, so that I can see at a glance all the selectors that start with #footer. In other words, I can see all the footer CSS grouped together.

Purists will argue that this breadcrumb-type selector identification isn't efficient, since it adds extra bytes, and it probably isn't true to the "spirit" of CSS either. Again, I would argue that there's a trade-off between being pure and being practical, and you have to strike a balance.

5. Explain Your Hacks

You may have expected that I would want my freelancers to provide many clear comments in XHTML. Truth is, so long as the designer has coded neatly and efficiently, and has had adhered to the tips I've already mentioned, I don't need to see many other comments. At that point, the HTML and CSS documents should be straightforward*. In fact, commenting the obvious may be irritating.

CSS hacks are different, however. There is a large and still growing zoo of hacks for the various browser bugs. I don't intend to learn all of them, let alone try to keep up with them.

All I need to know is – what does your hack do? Often this simply means what browsers is it hiding from/visible to?

For example:

/* Hides from Firefox all versions/platforms \*/

/* Hides from IE5.x-windows \*/

*I also like to see clear and detailed comments when the document contains non-native code -- such as PHP, JavaScript, MT or Wordpress tags, etc. But I haven't dealt with this here as I'm concentrating specifically on (X)HTML/CSS.

How Flash Lost the Rich Internet Application Race

When FutureSplash introduced a browser plug-in called FlashPlayer in 1996, I thought, "this is interesting". By 1999, when whole, groovy websites with bright colours, audio and animation were delivered in Flash (by then a Macromedia product), I thought, "this is going to change the web".

I spent the next year or two evangelising Flash, which had the good fortune of being bundled with IE, soon giving it a penetration of over 90%.

Around the same time, I discovered "usability". My fondness for Flash aesthetics conflicted with my passion for user-centered design. The truth was, most Flash-based sites looked great but worked terribly.

Jakob Neilsen seemed to signal the death-knell for Flash when he wrote in October 2000 that Flash was 99% bad.

I understood the argument, but I didn't fully agree. A colleague and usability expert Chris Rourke pointed out that Flash wasn't the problem; the way it was used was the problem. Theoretically, you could build a Flash site that perfectly replicated a HTML site.

I held out hope for Flash when Macromedia introduced Generator 2.0 in 2000. Generator allowed Flash to talk to a database. Flash sites could now achieve something regular web pages could not - they could update data on-the-fly, without the user having to refresh the page.

Using Flash and Generator, web developers and designers could now build Rich Internet Applications (RIAs).

But very few of them did.

A few more years went by. Flash sites continued to be show-offy and user-unfriendly, so I gradually withdrew my support. I believed that Flash had its uses but these were limited to online software demos, etc. Flash continued to improve as a product, and was bought by Adobe in 2005, but the web still boasted all-too-few examples of Flash-powered RIAs.

Today, we mainly encounter Flash in intrusive advertising, though it is also finding a niche as the best way to compress and deliver video clips (think YouTube).

Meanwhile, RIAs are suddenly all the rage - see Gmail, Kayak, Google Docs, etc. But these RIAs don't use Flash; they use AJAX.

How did Flash lose out on the race to deliver RIAs? Let me suggest a few reasons:

1. Proprietary Code and Applications
The code used within Flash is called ActionScript. It's like JavaScript but it's different. Coders wouldn't have any use for it outside the Flash environment.

In addition, the only database that Flash works with is ColdFusion. Most web developers, on the other hand, prefer to work with common web scripting languages such as JavaScript, PHP, etc. They like to use low-cost environments, particularly the LAMP environment.

2. An Association with Graphic Design/Animation
People associated Flash with fancy graphics and things that clicked, buzzed and whirred - not serious computing.

3. Lack of Available Talent
As a result of 1 and 2 above, Flash developers (as distinct from Flash Graphic Artists or Flash Animators) are thin on the ground.

As Jonathan Boutelle puts it:
It is definitely easier to hire "vanilla web developers" than people who can do real engineering using Flash. I've ... resorted to hiring Java Developers and retraining them. ... You just don't face these kinds of staffing issues with JavaScript: there will always be web developers.

So, RIAs are here to stay. But Flash? Who knows? Still, I hope those Flashblocker guys don't get their way.

How to Add Google Maps to Non-US Websites


On the Mediajunk main site, I've added this Google Map showing the location of our offices. On a client site, I've added a map showing their location in the Algarve (would have been useful if I've had this before I went to stay there!).

There are a few different guides out there showing how to add a Google Map to your website, but most of them have a major flaw - if you're living outside the US, you can't use the usual recommended tools (e.g. Geocoder.us) to find the exact latitude and longitude of your location.

The workaround that I used to find the co-ordinates I want was to look up the locations on Quikmaps.com. Apart from being a really neat tool, Quikmaps displays the centre co-ordinates at the bottom of each map. Scroll the map and you'll see those co-ordinates change accordingly.

So, to find the co-ordinates of your location, just get that location into the center of the map. Use these co-ordinates as both the "map centre" and "marker" in the JavaScript variables (shown below).

How to Create the Map

You'll need to sign up for a Google Maps API key to run a map from your own website. This only takes a couple of minutes. Add the Javascript code with the key to your HTML document's header.

Add this onunload event to your body tag:

<body onunload="GUnload()">


Add this code where you want the map to appear:

<div id="map" style="width: 530px; height: 300px"></div>


Add this Javascript code just before or after your closing body tag (it needs to be here to avoid a bug in IE). Remember to change the co-ordinates to your own.

Keeping Up with the Browsers

Reading a recap of the browser battles of the last decade in the Independent, I wondered if we're ever going to reach a time where all browsers display pages in the same manner?

Probably not. After all, there are many pages on the web that haven't been updated for years, and some that never will. Companies who build browsers can't simply expect users to keep up with them. Okay, clued-in web designers will try to stay ahead of the curve when it comes to CSS, XHTML, etc., but Joe Public doesn't know and doesn't care.

As an aside, Microsoft has recently been forced to change Internet Explorer due to a legal battle (it lost), affecting the way IE displays embedded objects (such as Flash-based interactions) on web pages.

Whenever a page has a Flash movie, or Java applet, IE now gives you a thoroughly annoying message, declaring click to activate and use this control. Worse, you see an ugly grey border around the image, and you have to click it before it will act as anything other than a simple image or animation.

Talk about killing usability. What really pisses me off is that Microsoft updated (i.e. crippled) my browser "automatically", while my computer was idle.

But don't worry, they say, as they have released examples of how to re-write websites in order to avoid giving users this message. Of course, the billions of web pages out there containing Flash etc. are now going to be carefully rewritten by diligent webmasters with loads of time on there hands, right?

Ri-i-i-i-i-i-i-ght.

Mediajunk is No Longer Updated

Visit Michael Heraghty's current blog at User Journeys

About

Mediajunk was Michael Heraghty's blog from 2002 to 2010, with articles on usability, UX, SEO, web design, online marketing, etc. More »

follow me on Twitter