IE BASE Tag Bug

Bengt e-mailed me with a problem he was having using one of my layouts on a Drupal-powered website. He linked me to a thread on Drupal’s forum about the problem.

After a lot of hacking around I felt confident enough in my findings to post my initial findings on this bug, what triggers it, and how to work around it.

Symptoms Of The Bug

The initial signature of this bug is text in IE is not selectable. Attempts to highlight text doesn’t work or you’re only able to select a whole block of text. What other issues there may be that are caused by this bug I don’t really know, but I’m sure there’s a few others.

Cause Of The Bug

It’s the BASE tag. It seems by simply including a BASE tag will trigger this bug.

The symptoms only appear when IE is in standards mode. It does not happen when it is quirks mode.

When in standards mode I found that if you stuck a closing BASE tag, the symptoms go away. Unfortunately a closing BASE tag is forbidden under HTML 4.01. But it appears to be perfectly valid under XHTML.

A lot of XHTML pages will use the short-had version of a closing tag, which is simply a forward slash before the greater-than sign used to close an HTML tag. This short-hand version doesn’t remove the symptoms. Only a full-blown closing BASE tag does it.

A closing BASE tag does not put IE into quirks mode. IE remains in standards mode, but HTML 4 documents will be called invalid by the w3 validator.

So What To Do?

XHTML users need not worry. Just throw in the closing BASE tag and you’re fine.

HTML users have a couple options. You could force IE into quirks mode somehow (bad/missing DTD… see here for more information) or you could toss in a closing BASE tag and just live with the fact your page will be marked invalid.

Or you could just not use the BASE tag alltogether.

Or, last, but not least, you could use IE conditional comments. It’s proprietary stuff, and I’m not a big fan of that, but it gets the job done in delivering valid HTML 4 documents that don’t break under IE.

<base href="http://drupal.org/"><!--[if IE]></base><![endif]-->

I’ll toy with this a little more, but what’s there is probably best.

Advertisements

HTML 5 Thoughts

I’m busy with my real-world job trying to piece together a portal using Oracle’s Portal product. It feels very bloated and overly complicated but there’s solid support for the product which is at least part of the reason why the decision makers probably went with it. It just takes some time to get my head around all the little nuances. Although it leaves me wondering when I come across some portlets released by Oracle themselves which seem lacking, such as the Exchange 2000/2003 portlets not supporting SSL (they use OWA to access user’s information, which is almost always done over SSL … wtf?) or a discussion forum which has the word “Product” hard coded into everything. You’re not adding a discussion, you’re adding a “product”. You’d think there’d be a little more customization built into these things but.. nope.

Anyways, that’s what I’m up to.

Yes, Virginia, there is an HTML 5. But it’s going to be known as “Web Applications 1.0”. I have not had the chance to fully read the spec but only glance through it. It looks like there’s going to be a lot of new things to play with, but I’m worried pages are going to get very complicated very quickly.

That’s one of the things I really like about HTML 4, it really isn’t complicated. It provides only basic data structure but allows you to build up complex structure from those basic elements. HTML 4 is made of individual blocks and it is up to you to build a castle. With HTML 5 I think we’re seeing some parts of our castles are now prefab which would seem to make our lives much easier. But I’m a little worried that things are getting overly complicated. I see things like the bitmap canvas and wonder if some sort of descrimination isn’t being built-in (or further enhanced) against non-visual clients (visually impared users, applications which can only process text, text-only interfaces). It’s as if HTML 5 is trying to mimic the features Flash or JAVA can already provide.

I’d like to see an HTML 5 where HTML 4 syntax was tightened up. Where we had a much larger definition on how browsers should handle/render specific tags. Try and relieve any abiguity left over from HTML 4. Try to settle down on a simple, easy to use, easy to implement standard that can be supported for years to come. Rather than develop a spec that will put current browsers into obsolescence in only a few years. It will be Netscape 4 all over again.

And I really wish these specs didn’t lay down those features clients ought to try and implement now with the assumption they will become “law” when the w3 signs off on the spec. We ran into problems with this sort of approach back in the days of Netscape 4 and CSS. Let’s hold off a bit and wait for a final spec before we all rush out to develop new browsers. Maybe then we can get some consistency between platforms.

But we’ll never have consistency.

Because instead of tightening the already existing spec of small blocks with which we can build whatever we want, we’re being given prefab parts that will fit everyone’s castle differently. We’ll have inconsistent support across browsing platforms. User experiences will differ and us web developers will either have to not use the new HTML 5 features or work around bugs in browsers as needed.

It’s CSS all over again, or at least it appears to be. And that worries me a bit.

Natasha Alexandra

Shameless plug for Natasha Alexandra. Turns out this lady is a friend of a friend who tossed me a copy of her CD In Your Face to check out.

I really dig the slow beat to “I’ll Go”, that was the first song I listened to and what drew me in to listen to the rest of the CD.

The way I handle music is I listen to the sound and don’t listen to the words. So I can’t really give you much on lyrics at the moment (posting this while the experience is still fresh in mind).

The sound and beat from “Refuel” reminds me of Citizen Cope. Probably my second favorite track on the disc.

One person described her as a “more soulful Alanis (Morissette)” and I agree, she sounds a little like Alanis but not as nasal. Throw in a dash of Tori Amos and I think you start to get the picture. I think the music is a little more modern than either of the previously mentioned ladies.

One thing I really like is each track has a different sound. It’s not all the same thing. So if one track isn’t your bag, skip to the next one and it probably will be.

I think she also sounds a little like Hope Sandoval (lead singer of Mazzy Star).

Check out the liner notes:

This album is dedicated to all the Underdogs…
Big love to all who have inspired me & denied me.
Fans, Family, Friends & Fools… you all kept me on track

You get a hint of the attitude behind the music.

I have no idea where you can score her CD but check out her website and keep an eye out for her disc.

Good CSS Hacks

Found an interesting article titled Avoiding CSS Hacks for Internet Explorer.

This article stems from some discussion over how CSS authors should handle CSS hacks so their layouts don’t break as future versions of browsers are released (such as IE7 which should be out soon).

Be sure to check out Tantek’s post. He lays down 3 rules on what CSS hacks should be. It’s really a nice and simple list to take to heart when developing CSS. I break all 3 rules all the time, but now I’ve got this list in the back of my head to help shape future work. Rule 3 I think is especially interesting in which he states that CSS hacks should be ugly. That the poor aesthetics of the CSS from the rest of your stylesheet make it obvious that it’s a hack and something you will want to revisit as times change with new browsers.

Now I hate ugly CSS. I’m a stickler for aesthetic. But I’m giving the idea some serious thought on future work.

Still.. I’m sure stuff I’ve done will break with IE 7. They’ll fix some stuff, but not all of it. So some hacks will break. Tantek covers this a bit and seems to say “screw it” to IE 7. That it’s Microsoft’s responsiblity for creating a solid CSS 2.1 implementation. If they don’t, it shouldn’t be our responsibility to work around another browser.

Thing is, we’ve been doing that for so long, I don’t know if that kind of stance will hold up.

We won’t know how things play out until IE7 goes to market. It should be a fun time.

Oh, and check out this little bit on the optimism tax. It’s a nice simplification of some deeper beliefs of my own (and probably others). Although I think it’s best said (and most simplified) with the old saying shit happens.

Categories

I’m not using the categories feature enough, so I’m going to try and make more use of that feature. The one I’ve just added I’m calling Informational (although if you’ve got a better name, please tell me) where I’m going to put any blog posts that have information I’m constantly referring people to. For example, the one post in there right now is from almost a year ago where I talk about changing column widths in the skidoo layouts and why columns will be pushed down in a layout. Those questions come up a lot.

Conferences?

I’ve got an opportunity to attend a conference or maybe even two this year. I’d like to attend something that’s heavy on web design but doesn’t have to be only on web design. Does anyone have any suggestions? I’m very outside the loop on such things so any suggestions would be appreciated.