Background on html

March 24th, 2008

There’s a paragraph in the CSS specification regarding the background property that states the following:

For HTML documents, however, we recommend that authors specify the background for the BODY element rather than the HTML element. User agents should observe the following precedence rules to fill in the background: if the value of the ‘background’ property for the HTML element is different from ‘transparent’ then use it, else use the value of the ‘background’ property for the BODY element. If the resulting value is ‘transparent’, the rendering is undefined.

This might lead to a surprise when trying to add a background on top of what you have on the body element – when you add a background property to the HTML element everything will shift. You can observe this in most browsers on the links below.

Before:

html {}
body {background:#fcc;}

After:

html {background:#ccf;}
body {background:#fcc;}

It seems you really have to add a semantically meaningless element…

Content patterns

February 9th, 2008

When laying out a website everybody has a few building blocks that they keep using over and over. The more layouts you make, the more refined these blocks are. And the better. I’m not talking about creating the HTML but rather the IA (information architecture) phase of the creation process when you’re creating wireframes with boxes that represent content.

I recently read an article on design paradigms for lots of data which made me think about what I commonly use when laying out pages. I’ll call this the one-few-many content pattern.

The main premise is that content on a website is presented in one of three basic forms – “one”, “few” and “many”. Let’s see what all these are and how they work together.

One

This one is the most obvious and consists of displaying a single entry. When you do this you will most probably want all the data a certain entry (asset) contains. You will use this block for a single news item, blog post, product page or anything similar.

  • CNN sample
  • Yahoo! sample
  • BestBuy sample
  • NY Times sample

To lay out the single content you will first need to decide on the importance of content parts, then set the layout. You will need to think about what content you’ll always have and what you might not. A common case of this are images that can change the form factor and might not even be present sometimes. When you know what you’re working with you’ll want to set priorities and based on that the size and shape of the parts. You should know that users can only focus on a few things – if everything is important and exposed essentially nothing is. The common solution in the cases is to put the image title on the top left, add meta data (author, date and similar) just below it. A single image is positioned on the top left with content flowing around it. A nice touch to this layout is to have the image a few lines below the top.

Few

A little less obvious that the previous one. This is usually a list, that is not a true list, but a short tasting of what’s there. You might think of this as “last 5 news” or lists on the front page that only list a few items. To display these you will not need as much data as you would for “one” but you need something. For a news and blog posts you’ll need at least the abstract, products will need the image, prices, discounts,…

  • CNN sample
  • Yahoo! sample
  • BestBuy sample
  • NY Times sample

You will see this block in many different shapes. You might see a thumbnail image with a title and an abstract in online stores you will see more data. In some cases it nowadays replaces the many block. A big part of this is that searching is very popular (no more lists) and using this block gives more information than using a simple many block.

Many

The last one of the bunch is pretty obvious but it might be hard to tell the difference between the last two. This is a list that is primarily used to list content when you have a lot of content and you do not want a user to browse through 10+ pages of paginated content or scroll 30 screens down to find something. You usually need less content, a title will usually do the trick, sometimes you need the date, products definitely need the price.

  • CNN sample
  • Yahoo! sample
  • BestBuy sample
  • NY Times sample

Using this is very easy and utterly unpopular. Displaying data only as a list is not very user friendly since it requires reading – something people rarely do on the web. This is why the many block often disappears in favor of the few block. A common place to find it is in the search results or the archive page.

To demonstrate the use let’s think about a simple corporate web page. On the first page you’ll most probably want to show a set of products using the few block, some news, again using a few block. Most of the content on the page will be using the one block since you’ll only have single articles describing what the company does. The news portion of the site might use the few block on the landing page, the many block for the archive and of course the one block to display a single news post. Displaying the products will be a bit different – the landing page might use the few block to display exposed, new or discounted products. The category listings will use the many block which will include an image with the title and some products specs or a short description. Again you’ll be using the one block to display a single product.

This doesn’t solve all the problems when laying out the page. It helps me define the main blocks and the content that’s used to display them on the page. It also makes some of the choices easier and helps the designers envision what the final, more detailed wire-frame might look like early on in the process.

Blogstorming X-UA-Compatible

January 28th, 2008

I’ve been trying to ignore this issue since I doubted I could have added anything to the debate.

I understand Microsoft, I first saw Chris speak in London and met him later at Mix07 at the POSH table. I can’t say I know what’s going on in his mind but from what I gathered he has a job many of us would not even want. How do you promote standards without breaking the internet – not only stuff other people made but also pages that are made by your own software (think not only FrontPage but also SharePoint) or networks you yourself need to maintain.

What Eric did to prevent a flame war between web developers was amazing. If all the discussions around the development and progress of web related technologies were this civil we’d probably already be using HTML 5 and CSS 3.

Broken by Jeremy Keith outlines the main problem with the technique – you have to use it to disable it. Pardon my language here, but that’s plain stupid.

Or is it?

Reasoning

Microsoft does not want support calls about IE8 breaking pages and they don’t want calls about their SharePoint breaking (believe me, it will). There is no way of knowing when the new IE8 engine should be used. There’s also no way of them saying “Hey guys, change your page for it to work in IE8”, since they’d ultimately be saying “We need to roll a SharePoint update for this.” If you’re making a page for IE8 you can just add this as you make the page.

The ultimate goal

What we need to achieve is that the feature is there to be used but the default for the rendering is IE8 or more generally the latest version of the browser we’re using. To put it another way I think that IE=edge should be the default.

Possible solution #1

IE is famous for it’s yellow status bar. I know people don’t usually see this bar even when it does appear but how about using a semi reliable logic to define whether to render in IE8 or IE7 (think Date header, Generator META tag, HTML features) accompanied with a bar like this:

Page rendered with a legacy display engine. Set the display engine for this domain.

If the META header would be added it would work as described. If it wasn’t it would check a Microsoft provided and internally updated list of set page-rendering pairs (per domain?). If there’s still nothing found we enter the fuzzy logic that is biased to present the page in the latest IE8 rendering. If the fuzzy logic decides that IE7 should be used it displays the infamous yellow bar.

Possible solution #2

Let’s assume that usually pages that are “broken” are broken all over the domain. If this is enough we can use a proprietary solution for this problem. When Adobe Flash wants to make cross-domain requests it first requests a proprietary file called crossdomain.xml. Let’s say that IE8 requests a ua-compatible.xml that contains the URL patterns with corresponding IE rendering engine version. This would defy the idea that there needs to be no change to current pages but I would say that a single file for the whole domain is not too much to ask.

Summary

I know the proposed solutions might not be what we’re looking for (yes, I think I, and all other web developers, have a say in this). What I think we need to do is find other possibilities that might not have the side effects that the current one has. Microsoft might want to elaborate on what they’re looking for – we won’t question their reasons, we’ll just try to find a solutions that suits all of us. So let’s have a brain storming of blog posts (blogstorming?) and we might find the ultimate solution.

Stop Web Pollution

January 10th, 2008

SEO is a theme I have been trying to ignore for a long time at Spletne urice, a weekly meeting of (mostly) web professionals. As a programme director and before that only a voice that could be heard my opinion on the matter was that SEO is a simple thing if you’re a web developer (semantic HTML – POSH, web standards, level 1 accessibility) and is a boring issue. The only way a talk about SEO would be interesting was a talk about its dark side. As people might mistakenly think that I (and my predecessor before me) endorse this kind of behaviour I declined any such propositions.

After a few debates and brainstormings I figured what bothered me the most – the notion that all real SEO experts have no conscience and would therefore not be able to talk about the shortcomings of polluting the web with pages that exploit the imperfections of search engines to create traffic and the desperation of users that will click on any banner that promises a better life. I trusted my instincts and invited Mitja to give a talk on SEO and I’m really glad I did. As he said in the talk – a retrospective of what he’s done in SEO made him think and he and Davor (his co-speaker) launched a site called Stop Web Pollution for all of us who don’t want the Internet to become a “big pile of shit”.

While we’re on the topic I’d like to point you to a video of a presentation made on Le Web 3 ’07 conference by Jason Calacanis. You can find it in the “07 – Day 2” tab, the title is “Internet Pollution”.

No more Navigator

December 30th, 2007

Adactio is calling you an adversary, but I always thought of you as a friend. It’s been some time since we last met, I know work with your cousin and am flirting with a Norwegian girl that’s gotten a promising makeover. You’ll be remembered

iPod Shuffle instructions

December 26th, 2007

I love them – it’s 26 pages of pictures with not more than one sentence on the page – all in all only 22 illustrated pieces of information. Only one language – no redundancies.