November, 2007 Results

How’s Your Vocabulary?

Friday, November 16th, 2007

Here’s some fun facts for Friday from Stuart Flexner’s I Hear America Talking book.

According to Flexner, there are an estimated 600,000 words in our English language — but the average American only understands around 2 to 3 percent of them and actually uses only half that amount. Flexner says, “Just 10 basic words account for over 25% of all speech and 50 simple words for almost 60%, with between 1,500 and 2,000 words accounting for 99% of everything we say.” The most commonly used word is I, followed by you, the and a. Of our written language, Flexner says, “is only a little more varied than our spoken one, 70 words making up 50% of it.”

Hip to Be Square

Wednesday, November 14th, 2007

Have you looked at other people’s style sheets lately? Were you baffled to find square brackets in the CSS code? If so, this article might be of interest to you.

What Does It Mean?

Curly braces should feel comfortable to any CSS author, since you cannot write any useful CSS without them. Regular parentheses should be fairly familiar, too, at least if you’ve used functional notations like background-image:url("/images/bg.png") or color:rgb(128, 128, 255). But square brackets?

The square brackets denote an attribute selector – a concept that was introduced in 1998 in CSS Level 2. An attribute selector modifies a simple selector by imposing an additional constraint on it. Does that sound like Greek to you? (Or like something other than Greek, for those of you who are, in fact, Greek?) Don’t worry, we’ll look at some examples in a short while.

Why Should You Even Bother?

But first, let’s address another question: If attribute selectors really are useful, why didn’t you already know about them? Or, to turn it around, since you’ve managed to get by without them, what’s the point of using them?

The reason you may not have heard about them is quite simple: Internet Explorer for Windows up to and including version 6 don’t support attribute selectors. Since the market share for those browser versions has been well above 80% until very recently, there hasn’t been much incentive for using attribute selectors in public-facing websites.

Version 7 of IE does support attribute selectors, though, and as more and more users upgrade from IE6, attribute selectors gain more interest.

What can those newfangled attribute selectors do then, that’s so useful that you should take some of your precious time to learn about them? The answer is that they allow you to do a lot of things that you hitherto have had no other way to achieve than to pollute your markup with class attributes.


Links for the Weekend, 11-10-2007

Saturday, November 10th, 2007

Look What’s Just Popped Up!

Thursday, November 8th, 2007

I was recently asked to create a pop-up message box for a client. The requirements were as follows: as the message box pops up the rest of the screen needs to dim, much in the same way as the lightbox effect. This needed to be achieved with minimal JavaScript; which was quite lucky because my JavaScript skills are minimal anyway. Another requirement was that the message box be vertically and horizontally centered in the viewport while the content underneath should still remain scrollable.

In hindsight I could have directed the client towards the lightbox script. However, I thought it might be fun to see how far I could go using mostly CSS and only using a snippet of JavaScript to swap an ID to effect the changes required.

Before we get started have a look at the end result so that you are familiar with what we are trying to achieve. The CSS has been left in the head on purpose so that you can view it easily.

First Things First

The first thing we need to do is decide on a plan of action. Let’s list the things that need to be done:

1.) Construct the message box itself (difficulty level – easy)

2.) Center the message box in the viewport both vertically and horizontally remembering that we have no fixed height to work with as content will determine the height of the message box (difficulty level – medium)

3.) Fix the message box so that it stays put in the viewport and doesn’t scroll with the document (difficulty level – hard)

4.) Fade everything else on the page except for the message box (difficulty level – awkward)

Let’s Get Busy!


Link Swapping – Should You Do It?

Monday, November 5th, 2007

Like you, I get the occasional email asking if I would be interested in swapping links. I usually politely decline. But that’s not to say that I’m against link swapping. I think there is one situation where link swapping can be a good idea. This article will look at when to swap links and when not to swap links.


Links for the Weekend, 11-3-2007

Saturday, November 3rd, 2007

mulberry sale spyder womens jacket cheap new balance 574 mulberry outlet cheap new balance 574 arcteryx outlet mulberry sale spyder womens jacket mulberry sale spyder womens jacket mulberry outlet mulberry outlet new balance 574

Popular Articles

Top 10 Commentators

Subscribe to this feed! Subscribe by Email!

Random Bits Podcast

You need to download the Flash player from Adobe

Blogs Worth Reading