Posts from 2004

Floating Points

Published 20 years, 4 months past

It seems I was a little unclear in my recent post about floats, and compounded the problem with the post title.  A number of responses said, basically, “maybe they’re bad for layout but what else is available?”  I didn’t mean to suggest that nobody should use floats for layout, or that using them in that manner is somehow wrong; my apologies if I did so.  There aren’t too many alternatives; in fact, there are precisely three general standards-based layout options.

  1. Floats
  2. Positioning
  3. Tables

Each of these options has its benefits and drawbacks.  All I was trying to say is that Andrei was dead on in his feeling that layout floats feel like something that have been bent to a purpose for which they weren’t intended.  That’s true.  Floats are simple, and were meant to do a very limited thing.  Push them hard enough into other roles, and they become a touch balky.  If nothing else, their source-order dependencies make them less flexible than one might like, and variances in browser handling of floats (many of those variances having to do with how one should deal with floats in their intended role) just makes the situation more frustrating.

One could argue that all three options are non-layout technologies that have been bent to layout purposes, but positioning at least was intended to be a layout mechanism from its inception.  It suffers from enough glaring flaws and browser bugs that it can’t be considered any better an option than the others, though.

In a move that may help matters, Shaun Inman (he of the Inman Flash Replacement technique) has just published the article Clearing Absolutes Again, which  further develops his attempts to give positioned elements a clear-like capability.  This is a very welcome development.  The IPC (Inman Position Clearing) technique may not be perfect— I haven’t had time to dig into it, so I don’t know— but it’s a fifty-foot neon arrow pointing in the direction things need to go.  Since we can’t expect this sort of capability to be added to CSS in the near future, let alone have enough browsers support it in the next few years, scripting our own fixes is the only reasonable solution I can see.  For another great big neon arrow of this kind, see Dean Edwards’ IE7.

And yes, I said “tables” back there.  If you can avoid using tables for layout, then by all means do, but it isn’t always possible.  In such cases, as long as the tables use as little markup as possible, and the markup validates, then I don’t see the problem.  Never have, really.  My whole objection to tables-for-layout has been, and continues to be, that most table-based designs use way too much markup.  Often you see markup-to-content ratios in the vicinity of 3:1.  That’s just icky.  I much prefer to see the inverse of that ratio, or at least something below 1:1.  CSS helps immensely in getting there.

Update: see Shaun’s new new post on the topic, “Absolute Clearance“, for another step in the evolution of his technique.  Ever forward!


Iron and Candy

Published 20 years, 4 months past
A picture of Eric and Kat in profile, touching noses and smiling.

It’s been half a dozen years since Kat and I exchanged wedding vows on a hot Long Island summer afternoon, vowing before a small gathering of family and friends our intention to provide mutual support, understanding, and daily laughter.  We were married by a justice of the peace, the colleague of Kat’s across-the-street neighbor Lester.  She had long planned to have her neighbor, also a justice of the peace, officiate at her wedding.  Unfortunately, he died before we’d even met, but he was there in spirit.  It was Lester’s old judicial robes the justice wore when he presided over our marriage.

At times, our vow to bring laughter to each other has been sorely tested, but we always come back to it.  It’s one of the best promises we’ve ever made.


Competent Classing

Published 20 years, 4 months past

At last week’s Web Design Meetup, a couple of people showed me their current projects.  As is my wont, I glanced over the visual design and then started digging into the document markup.  In the course of the resulting conversation, I pointed out some ways to tighten up the markup.  I’ll repeat them here for those who are curious.  All of them relate to using classes and IDs efficiently.

The first recommendation I had was to use classes and IDs in conjunction.  Not everyone is aware that an element can carry both a class and an ID.  Well, they can.  So it’s no problem to have markup like this:

<div id="utilities" class="menu">

That way, you can style all menus consistently via the menu class, while having the utilities ID there for any ‘Utilities’-specific styling you need to do.  This has always been possible, and it’s supported by multiple browsers.  You don’t see it often, I admit, but then it’s not often needed.

The second recommendation was to use space-separated words in your class values.  This is thoroughly legitimate, and can make things a lot more compact.  So you might have something like:

<td class="subtotal negative">(-$422.72)</td>

You can then have one rule that styles all subtotals, and another than styles any negative number.  For example:

.subtotal {font-weight: bold;}
.negative {color: red;}

By using these kinds of class values, you can avoid having to construct one class for subtotal, and another for subtotal-negative.  If you’re doing that sort of thing, I can tell you right now that your CSS is larger and more complicated than it needs to be.  Multiple-word class names also free you from having to do things like throw in extra spans or other elements just to add more information, like so:

<td class="subtotal"><span class="negative">(-$422.72)</span></td>

That kind of structure is almost never needed, except in extremely rare cases where you must have an inline element on which you hang some presentational styles that can’t be applied to the table cell.  I can’t even think of a concrete example right now, but I’m sure there is one.  In which case, I’d say do this instead:

<td class="subtotal negative"><span>(-$422.72)</span></td>

But, as I say, the odds of your having to do that are very very low.

All this leads to a third recommendation that came to mind as I looked over the markup.  Remember to use document structure to your advantage, and not to class everything in sight.  I can’t tell you how many times I’ve seen this kind of markup:

<div class="navlinks">
<a href="blah01" class="navlink">Blah01</a> |
<a href="blah02" class="navlink">Blah02</a> |
<a href="blah03" class="navlink">Blah03</a> |
<a href="blah04" class="navlink">Blah04</a> |
<a href="blah05" class="navlink">Blah05</a>
</div>

Out of the six classes that appear in that markup fragment, five are completely useless and simply bloat the page weight.  Here’s a much more efficient way to structure the markup:

<div class="navlinks">
<a href="blah01">Blah01</a> |
<a href="blah02">Blah02</a> |
<a href="blah03">Blah03</a> |
<a href="blah04">Blah04</a> |
<a href="blah05">Blah05</a>
</div>

Now all you do to style the links is write a rule that uses the selector div.navlinks a instead of one that uses a.navlink.  In addition to making the HTML weight smaller, it also makes the document cleaner and a whole lot easier to read.  Your users don’t really care about that, of course, but I bet you will, if you ever have to go in and adjust either the markup or the content.

So there you go.  Hopefully it was of some help to you.


iLike iLife 4

Published 20 years, 4 months past

Long-time readers may recall my ranting about iLife 4 being a for-money upgrade, which in the end was as much about my lack of understanding as it was about Apple’s (perceived) silence on the subject.  As it turns out, I never got around to buying iLife 4, so I was happy to have it bundled with my new PowerBook.  That’s right, folks, I spent over $2,000 on a laptop, but I saved $49 in the process!  Ph34r my l33t sh0pp1ng sk1llz!

So I imported my entire iPhoto library into iPhoto 4, which only took about 45 minutes.  In the process, I discovered that I actually have 4,080 photos so far.  There was some weirdness, in that iPhoto 4 claimed to have discovered 234 “lost” images.  Under half were duplicates, and the rest were completely blank files with the same names as photos I already had.  So I threw them all away, and landed at 4,080 pictures.  Once I figured out the keyword interface, which is by no means intuitive (or even very usable), I set about adding metadata to some of my images.  The first order of business, of course, was to tag all pictures of Carolyn and organize them into a smart album.  Guess how many pictures I’ve take of her so far?  We’ll have the answer in a moment, but first, here’s a recent one of her sitting up on her own, which she started doing a couple of weeks ago. A picture of Carolyn sitting up and reaching upward, an enormous smile upon her face.

Everything I’ve heard about the improved speed in iPhoto 4 proves to be correct, and possibly understated.  This thing screams.  It still generates bloated directories, though, given the number of XML files and image copies it’s capable of producing.  This is largely so that it can support a “Revert to Original” feature, so any time you take out red-eye or lighten up an image, you end up with both the original and the modified image on your hard drive.  The same happens if you do no more than rotate an image.

That’s where iPhoto Diet comes in so very handy.  It’s a small application that can get rid of all unnecessary duplicates in your iPhoto library, and it can also delete the originals of all rotated images.  It can also wipe out all the originals, replacing them with the modified versions.  I ran it on my library before I migrated to the new machine and reclaimed over half a gig of drive space.  And that was only getting rid of unnecessary and rotated duplicates, not all originals.  I did a lot of red-eye reductions, and those are still around.  I also have yet to run the “strip thumbnails” option, which could easily reclaim a few dozen megabytes.

I haven’t really played with the rest of the iLife suite since I don’t have a video camera or a garage band.  I may eventually burn some images to a DVD for relatives to play on their TVs.  If I can figure out how to use Garage Band, I might try creating some background tracks for use in radio production work.  It’s nice to know the options are there.

And the answer to today’s trivia question is: as of this writing, the smart album titled “The Compleat Carolyn” contains 1,832 pictures.  At this rate, we’ll have about three thousand pictures of her by her first birthday.


Partied Out

Published 20 years, 4 months past

By rights, I should be a Republican.  No, I’m not kidding.  Bear with me for a moment.

If the Republican Party actually carried through on the core principles it espouses, I’d pretty much have to register that way.  I’m all for a decrease in government’s interference in the personal lives of its citizens, and that goes for silent intrusion as well as active meddling.  I’m all for the government being as small as it needs to be, and no smaller.  I believe that the government provides a number of critical services, and those should be funded, but that there should be intelligent restrictions on its growth.  I also believe in fiscal responsibility, in eliminating deficits, and in returning any surplus to the taxpayers (once all debts are paid off and services are funded).

So what do we have instead?  A party that proposes amending the Constitution to prohibit some kinds of marriage, that keeps increasing the size of the government, and that runs up massive debts while cutting off income.  Their leaders and highest-profile supporters tend to be the most annoying brand of hypocrite: preaching morality and decency while not acting in accordance with those ideals, publicly or privately.

As for debates about national security and terrorism, the more often I hear right-wingers respond to questions and criticism with accusations America-hating, the more I start to think that they have no rational policy, and their lame rhetorical attacks are meant to obscure this weakness.  It’s probably an unfair perception, but it’s hard to avoid.

Then, of course, we have the Democrats.  They’ve traditionally been in favor of increasing spending in order to provide expanded social services, which in any sane fiscal environment requires an increase in taxes.  Thus the old cliché of “tax-and-spend liberal”.  (To which I usually reply, “Well, duh, if taxes are levied then the money should be spent”.)  But the last Democratic president, faced with a surplus, used it to get government debt under control.  He didn’t try to blow it all on entitlements, at least not after the universal health care proposal died, or try to fund some massive boondoggle.  He actually used it to reduce the fiscal burden on future generations.

The usual argument is that he didn’t do this of his own volition, but was forced into it by a Republican Congress.  I no longer accept that claim, because I’ve been watching the current Republican Congress.  No real signs of fiscal discipline there, I’m sorry to say.  So it would seem that the party of smaller government and fiscal responsibility is, in reality… the Democrats.  Say what?

As for national security, the left has been great about asking tough questions, but not all that good at formulating a decent policy—or, if they have one, then they’ve done a terrible job of promoting it.  It’s one thing to criticize what’s being done, and quite another to propose a workable alternative.

And that leads us up to the 2004 Presidential election.  I’m reminded of the 1988 election, when I seriously considered flipping a coin to determine my vote.  Neither choice really made me happy.  Same thing here.  I’m no fan of President Bush or his policies, but I’ve yet to see that Kerry is a worthwhile alternative.  I know some people who say “Anyone but Bush,” but I categorically refuse to pick the leader of the country that way.  I know some people claim nobody could be worse than Bush, and I’m glad they do, because it makes their reality-distortion tendencies more obvious.  There’s plenty of people who could be worse than Bush.  The question in my mind is whether or not John Kerry would make a better leader than George W. Bush.

It would be nice if I could get a clear picture along those lines.  So far, any hope of finding out has been obscured by the fountains of venomous bile the two sides keep spewing at each other.  Back in late 2000, I wrote:

…I’m finding that every time a campaign spokesman from either side opens his mouth, my opinion of him drops.  Every time. That’s just, you know, depressing.

It’s no less true, or for that matter less depressing, at present.  And pundits wonder why voter apathy runs so high.  I honestly think it’s because most of us just don’t want to waste any more time listening to the shrill schoolyard taunts that pass for political debate.

It doesn’t help that most taunts are equally applicable to both sides, thus deepening the sense of futility.  To take just one example, the Republicans keep painting John Kerry as a “flip-flopper”.  How droll.  He has been a senator long enough to have voted in myriad ways, it’s true.  In some cases, it’s because one bill is worth supporting, and another is not, even though they’re ostensibly about the same thing.  In others, it might be that he’d changed his mind.  Most humans do, at some point.

Thing is, Bush is no less a flip-flopper.  He’s been against trade barriers like steel tariffs, and then for them.  He’s been against education reform, and for it.  He’s been against nation-building, and for nation-building.  He’s been against independent inquiries into the 9/11 attacks, and for them.  He’s been against negotiating with the North Koreans over their nuclear program, and in favor of negotiating with them.  Those are some pretty major changes of position.  And I’m generally okay with that; a pragmatist must sometimes change stance to get things done, and any intelligent person will change their mind if new and compelling information comes to light.  I will gladly accept a leader who changes his mind when it makes sense to do so, or even when they have become convinced of the need to do so.  Still, doesn’t it seems rather hypocritical of Bush and Cheney to excoriate Kerry for changing positions when W and company have been doing the same thing in fairly big ways?

It’s hard to take either party seriously any more.  I sometimes wonder if there will be a serious political party in my lifetime—either because one of the existing parties grows up, or due to a serious-minded third party actually gaining traction and becoming a force in national politics.  Both seem about equally unlikely.

And so I face the prospect of forcing myself to the polls, participating in the election process only because abstention is unacceptable to me.  Thus a right and a duty becomes a frustration and a chore.

That’s probably the worst part of all.


Upgrade Path

Published 20 years, 4 months past

As one might have been able to infer from my recent post on Airport Extreme, I got a new PowerBook; it arrived Thursday afternoon along with an iSight.  My TiBook is a little less than a year old, but I found someone interested in buying it for a decent price, so I figured, what the heck, why not reward myself a bit for all the work I’ve been doing and get a nice high-powered machine?

So I did.  Since I still have an 802.11b access point (the aforementioned MR814v2) I plugged both laptops into the router and got to work transferring files.  Even at 10Mb/second, it took a while to move everything over from one to the other; the iPhoto library alone took an hour to cop.  Having close to four thousand images, many of them with red-eye reduction, will do that.  Nevertheless, I was up and running within most of a day, and a couple hours of that were figuring out the whole wireless access problem.  And six hours of sleeping.

I like the key response on this keyboard.  It’s a little snappier than the TiBook.  But the coolest thing about the new machine so far?  The way that, in a low-light environment, the display will dim down a bit and the keyboard automatically backlights.  It’s just so sexy.

(Don’t forget, there’s still a little bit of time left to support the Blog-A-Thon!)


Head In The Clouds

Published 20 years, 4 months past

I recently wrote about being fascinated by clouds.  This fascination is something I’ve always had, and it doesn’t seem to have lessened over the years.  If anything, it’s become stronger.

More than a decade ago, I stood in a hotel room in Minneapolis and watched a tiny smear of a cloud appear, grow, shrink, and finally disappear completely from an otherwise clear blue sky.  As I watched it fade, I thought of the opening of Arthur C. Clarke’s Against the Fall of Night.  I still wonder why it appeared at all, especially since its lifespan was so brief.  If its existence was so tenuous to begin with, why did it ever exist?

On a recent flight from Minneapolis to Cedar Rapids, Iowa, our Saab 340 propeller plane nosed between and just over a series of wispy clouds.  I love looking at clouds from the air, particularly when they’re close enough to make out the fine structural details.  These were particularly complex, consisting of tangles of vaporous filaments that stretched and merged like pulled cotton.

Clouds mystify me.  What is it that causes one part of the air to contain a cloud, and another to be clear?  Put another way, what defines the edge of clouds, particularly the filamentary ones like those through which we flew?

At the macro level, of course, some atmospheric conditions simply don’t favor cloud formation.  The micro level is where I have the questions.  Once a cloud starts to form, what keeps it from continuing to grow until it fills the entire sky, or at least the entire vicinity?  As we flew over Iowa toward Detroit, there was a scattering of small, roundish clouds near the ground.  What caused them to form where they did, and why did they stay small and round?  Why didn’t they smear out, or build up in mass?  Another good example are the summer clouds that rapidly scoot through a clear sky on days that are not particularly humid.  The wind doesn’t rip these clouds apart, and they don’t seem either to grow or shrink.  What conditions formed them?  What holds them so firmly together?

As a child, I once ran out into a windy rain storm to look at the storm clouds overhead.  I stared straight up and saw a massive cloud wall stretching up into the haze and high-level rain, and in that moment I could almost feel the boundaries of the cold front as it swept over our house.  As a senior in high school, I watched a late-afternoon thunderstorm move away, bisecting the sky into dark gray and a profound golden glow that I can still scarcely believe existed.  I kept trying to understand how this combination could happen even as I thrilled at its existence.

I once thought seriously about studying for a career in meteorology, and this fascination is most of the reason why.


Scorning Standards

Published 20 years, 4 months past

So in the last week, we had relaunches of Feedster and allmusic.com, and both sites were straight out of the Nineties: “this site best viewed on…”, browser blockers, and general lack of standards awareness.  Scott Johnson’s response in the case of Feedster is, in effect, “we don’t have the resources to support all browsers”.

Yes, you do.  It actually costs less to support all browsers.

What costs more is obsessing over making a design “look the same in all browsers”, which is in any case impossible.  Your site can’t possibly look the same on a cell phone as it does on my Cinema Display, and it’s not going to look the same in Mosaic 1.0 as it does in IE/Win.  Remember Mosaic?  It didn’t support tables.  A table-driven layout will completely and totally shatter in Mosaic.  I wonder if Feedster has a blocking message for Mosaic.

The point is that if you properly structure your content, then you can make it available to everyone.  You can set things up so that in more current browsers, the site will look pretty.  In older browsers, it won’t.  If the user really wants to get your content but your styles confuse it, then the user can disable styles (all the older browsers, and many newer ones, let you do that via the preferences).  If you identify a particularly problematic browser—whether it’s IE5/Mac or Netscape 4 or Opera 3.6 or whatever—then you can use JS to withhold the CSS from the browser.  Users of those browsers get the content.  You can throw in a message telling them why the site looks plain, if you like, but the important thing is that they get the content.

For a site like Feedster, there’s really no excuse.  The main page is a search form that looks a whole lot like Google, except with more stuff on it.  After that, you get a list of search results.  The results will be just as useful with an unstyled presentation as with all the CSS in the world applied.  So to say that it would cost $1,500 to support IE/Mac, or anything else, is misleading at best.  It might cost $1,500 to figure out how to hack around a browser’s limitations in order to make the page “look the same”.  It would have cost $750 less to not take half an hour to implement a browser blocker and set up the blocker page, and just let all browsers in.  It would maybe have taken $275 worth of time to write a detector that withholds the style sheet from “unsupported” browsers, or else adds in a style sheet for the browsers you “support”.

As for allmusic.com, Tim Murtaugh created a more standards-compliant version of the main page in two hours.  Of course, it may not have consistent layout in multiple browsers, but another six hours could probably fix that.  I wish they would, because I use allmusic.com a lot in preparing for my radio show.  (And did I mention that the station has a new design for its site?  I had nothing to do with it.)  I won’t stop using it, of course, because they have good biographical information. but I wish they’d done better.  It would have been little enough effort to do so.


Browse the Archive

Earlier Entries

Later Entries