Archive for October, 2003

One-upsmanship

This past summer, razor maker Schick had announced the Quattro, a four blade razor. It’s pretty obvious they’re trying to “one-up” their competitor Gillette’s Mach 3 (which only sports three blades).

What’s next? You can already predict a “Mach 5″ with five blades — or maybe Gillette will skip over five and go for the even six. This could continue for years, and we can look forward to a razor that holds 12 blades, letting you shave in one stroke.

If I had the cash (and/or desire) I might look into starting my own razor company and beat them both to the puch with a five or six blade razor of my own. Why would someone buy the Mach 3 when they could buy a razor with five blades on it?

Personally, I like the Mach 3 just fine — but even better would be a razor with one blade that actually worked, and lasted longer than a few weeks.

This same “One-upsmanship” exists in all sorts of industries. Products touting “0 Carbs” are showing up all over the place, KFC is setting the record straight, announcing that eating their fried chicken is healthy because it’s a “high protein, low carb food” (they, in fact, are comparing the fried chicken to Burger King’s Whopper — where the chicken comes out essentially the better of two evils). Everything is Super-Sized and just barely better than any other competitor’s product on the market.

So, what’s my point? Is a world with four blade razors and zero-carb french fries better than a world with three blade razors and regular-carb fries?

SimpleQuiz › Smart Linking › Conclusion

Certainly some great discussion on smart hyperlinking methods. Many like B over the other three examples. I think I like this one best as well. The link is surrounding the description of exactly what it’s pointing to. Using a title attribute can be helpful if for some reason the text you’re using isn’t descriptive enough, or to name the document you’re linking to.

Option C’s use of “Click here” text was a hot topic of discussion as well. I tend to think, in general, it’s not always a good idea for the following reasons that many of the readers shared:

  • Not everyone uses a mouse to navigate a web page, therefore the word “Click” doesn’t make sense for every situation.
  • If “Click here” text is used repeatedly on a page, a screenreader that reads off a list of links found on that page would basically be saying “Click here. Click here. Click here.” over and over again. Being more descriptive about what the link is will help.
  • Visually scanning the page for links would reveal little about what is being linked to.

Another thing to keep in mind, and this was brought a few times, is how being descriptive when building links can help search engine spidering.

SimpleQuiz › Part IX › Smart Linking

To mix it up a bit, I thought I’d offer this quiz question from Egor Kloos. It sort of borders on the topic of usability — finding the best way to hyperlink something in context.
What method will make the best impact? What we link, and where, is a simple way of improving a site’s readability. But what do you think?

Q: When linking to something that appears more than once within a sentence, where is the best place create that link?

  1. <a href="#">The W3C's section on HTML has been used by many designers as a reference to build better sites.</a>
  2. The <a href="#">W3C's section on HTML</a> has been used by many designers as a reference to build better sites.
  3. The W3C's section on HTML has been used by many designers as a reference to build better sites. <a href="#">Click here</a>.
  4. The W3C's section on HTML has been used by many designers as <a href="#">a reference to build better sites</a>.

See previous quiz questions and wrap-ups in the archive.

Styling Nested Lists

Recently, I was building a site map and realized that it is basically an outline of sorts. So how should I go about marking it up? I settled on a series of nested tables — ha! gotcha — nested unordered lists.

The Raw Markup

At their very basic — nested, unstyled lists deliver the exact hierarchy I was looking for. I could feel good about the structure that all browsers and devices would read, while easily styling it with CSS later on.

A simple version might look something like this:


<ul>
<li>Weblog</li>
<li>Articles
   <ul>
   <li>How to Beat the Red Sox</li>
   <li>Pitching Past the 7th Inning
      <ul>
      <li>Part I</li>
      <li>Part II</li>
      </ul>
   </li>
   <li>Eighty-Five Years Isn't All That Long, Really</li>
   </ul>
</li>
<li>About</li>
</ul>

Figure 1 below shows us how the markup above will render in most browsers. Woilla. A site map or outline. But let’s kick it up a notch (apologies to Emeril).

figure 1
Figure 1

Adding Style

Let’s say that we’d like some definition for certain levels of the site map. All we really need to add to the markup is an id so that we may style this particular list differently from any other lists that may be on the same page, without any additional markup:


<ul id="sitemap">
<li>Weblog</li>
<li>Articles
   <ul>
   <li>How to Beat the Red Sox</li>
   <li>Pitching Past the 7th Inning
      <ul>
      <li>Part I</li>
      <li>Part II</li>
      </ul>
   </li>
   <li>Eighty-Five Years Isn't All That Long, Really</li>
   </ul>
</li>
<li>About</li>
</ul>

Using descendant selectors, we can give a unique style to each separate level of the list. For instance, if we’d like the higher levels to be large and bold and the inner levels progressively smaller, we’d first set the size and weight for entire list:


#sitemap {
font-size: 140%;
font-weight: bold;
}

That will make the entire list big and bold. So next we’ll reduce the size and turn off bolding for li elements that are nested at any level below:


#sitemap {
font-size: 140%;
font-weight: bold;
}
#sitemap li ul {
font-size: 90%;
font-weight: normal;
}

figure 2
Figure 2

This means that all top level items will be big and bold, while all lists that are nested within will have a normal weight and font-size of 90% (which in this case is 140% of whatever the page default is). Figure 2 above shows the result.

We don’t even need to assign a smaller size for the third level, as it’ll automatically apply 90% of 90% (a little confusing, but it works!):

Now we have a descending font-size for each level of the list.

Custom Bullets

Let’s turn off default styling, and add a decorative bullet for only third level items by using the background property. We’ll first turn off list styling in general for all li elements, then we’ll specifically assign a background image for third level items:


#sitemap {
font-size: 140%;
}
#sitemap li {
list-style: none;
}
#sitemap li ul {
font-size: 90%;
}
#sitemap li ul li ul li {
padding-left: 16px;
background: url(bullet.gif) no-repeat 0 50%;
}

figure 3
Figure 3

Figure 3 shows the resulting list with a custom bullet applied only to third level li elements. We’ve added 16 pixels of padding on the left to account for the width of the decorative bullet image we’re using (plus a bit of whitespace). We’re also telling the browser to align the image 0 pixels from the left and 50% from the top, which essentially aligns the bullet to the left and center of the text. While we could’ve used a pixel value here, using a percentage allows for similar bullet placement if text is resized.

Conclusion

For building outline-like lists, nesting uls makes for a structurally sound — and easily styled solution. By assigning a single id to the top-level ul, we can let CSS do all the hard work of styling each level separately — without the need for extraneous presentational markup. And possibilities for creative styling go way beyond this simple example.

Designing in Public

Hats off to Dave Shea for his redesign of Mozilla.org (publicly released beta). Nice, clean design and structured markup. It’s a great contribution to the project.
Also of interest are Dave’s notes on the response of the beta, and what’s left to tackle.
In general (and as Dave mentioned), thick skin is needed when designing a popular site (like Mozilla.org). Validation, accessibility, design choices, browser quirks — just a few of the hurdles to leap over when redesigning any site — but are then magnified ten fold when dealing with something larger than your average personal site or weblog.
The reality? Getting everything 100% “correct” is hard stuff.
Feedback is important and necessary, and trying to break a design — turn it on its head and shake out the bugs — can be invaluable. But what’s important is this: when all is said and done, any attempt in making gains in validation, accessibility, markup structure, etc. make the web site better than it was. And if you fancy yourself a web designer, your first gesture should be a tip of the (Red Sox) cap to anyone who dares.

Mid Pass Filter: Toward a Hackless Future

Just recently, Tantek revealed his Mid Pass Filter — a handy way of sending IE5.x/Win external CSS styles that all other browsers will ignore. Pretty neat.
I’ve read a few comments regarding the method, which complain of its somewhat messy syntax. My first reply would be “isn’t any hack is somewhat messy?”, but more important is the concept — keeping all IE5.x hacks in one file makes for a nice tidy cleanup when these browsers reach the Netscape 4.x threshold.
This of course could be years down the road, but I like the idea of keeping standards-compliant CSS completely separate from the various hacks that are often necessary to render a design in 2003.
The more methods that use this separation, the better. Imagine a time when getting your CSS 100% hackless is only a matter of removing the import of a single file that’s merely filled with all those old hacks. It’s a nice idea, anyway.

Perhaps a Book

Rally Cap
Rally cap by web

Stemming from the SimpleQuiz, I’m looking rather seriously into putting the question and answer concept into a book. The scope would most likely be more of a “web standards FAQ” — with topics on structured markup as well as CSS tricks and tips and anything related.

What I’m looking for is a little help…

  • What topics would be important to you in this type of book?
  • What are common questions that one would come up against when diving into standards-compliant design/development?

The format is looking to be much the same as the Quiz: a series of topics each with a question posed, followed by exploration of available options, summary and extra tips based on the topic.

I’m open to hearing any and all suggestions. Feel free to email me directly as well. Thanks, fine people.