No Mod Required

Archive for the 'html' Category

Another New Site I Made Is Live- Innocentive.com

It's true.

Make with the clicking:

Innocentive

If you're asking, "Who?"

From their About Us page:

"Founded in 2001, InnoCentive connects companies, academic institutions, and non-profit organizations, all hungry for breakthrough innovation, with a global network of more than 125,000 of the world's brightest minds on the world's first Open Innovation Marketplace™."

I did HTML, CSS, some JavaScript and a Wordpress theme/configuration for their PR/News section. I think the site looks pretty good, personally :)

A new site I made is live…

Officially :)

Boston Graffiti » Boston Graffiti Home

I did both design and development in my spare time over the past couple of weeks, with the entire HTML and Wordpress implementation taking a little bit over a day of work (split over four.) I love Wordpress :)

The Drupal site I mentioned yesterday is now live.

[edited to add:
*This site, since this article was written, has been completely rewritten. I'm no longer responsible for anything you see there in the way that I normally am. I tried my best, but we're working with Drupal in a big way so most of the markup, etc. is simply out of my hands. So, I don't really feel any ownership at all for the UI layer. Let's call it an Alan Smithee project.]

Behold the glory of eforallexpo.com, the official site of the Entertainment for All Expo, a gaming/ gadget/ entertainment extravaganza of the most hyperbolic proportions.

Or something*

Anyway, when checking it out, keep in mind this is really a primordial launch of the site. Things there are going to be ramping up over the next several months so it will eventually be a lot more interesting.

What's interesting to me, right now, is that I found an even better example of Drupal's bloated HTML than what I showed yesterday. On the front page we're presented with this awesomeness:

<div class="content related-content body">
<div class="view view-Blog-Listing-Home">
<div class="view-content view-content-Blog-Listing-Home">
<div class="item-list">
<ul>
<li>
<div class="view-item view-item-Blog-Listing-Home">
<div class="view-field view-data-node-changed">25/5/2007</div>
<div class="view-field view-data-node-title"><a href="/node/66">Mary Dolaher appears on Bonus Round</a></div>
</div>
</li>
<li>
<div class="view-item view-item-Blog-Listing-Home">
<div class="view-field view-data-node-changed">25/5/2007</div>
<div class="view-field view-data-node-title"><a href="/node/86">Podcast Episode 2 with Tommy Tallarico</a></div>
</div>
</li>
<li>
<div class="view-item view-item-Blog-Listing-Home">
<div class="view-field view-data-node-changed">25/5/2007</div>
<div class="view-field view-data-node-title"><a href="/node/83">Welcome to EforAllExpo.com</a></div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>

All I need out of that is this**:


<ul>
<li>25/5/2007<a href="/node/66">Mary Dolaher appears on Bonus Round</a>
</li>
<li>25/5/2007<a href="/node/86">Podcast Episode 2 with Tommy Tallarico</a>
</li>
<li>25/5/2007<a href="/node/83">Welcome to EforAllExpo.com</a></li>
</ul>

Drupal's code there is just insane. It would probably be cleaner to use tables and it'd definitely be easier to debug. With all those DIVs and generic, multiple class names attached to everything it'd be a train wreck trying to debug that stuff if you were using their classes and something was going wrong. I like code I can follow in my head without relying on post it notes, a team of interns, a dozen flow charts and a Venn diagram or two. That and I'm still as stingy as I can be with bandwidth and download times.

This is just one of those cases where things are out of my control and I have to live with it…

*I've been too damn busy building the thing to know what the heck it's really all about :)

**It's a very specific div with an innner structure I can predict so I could hook that UL with just the containing div id. The rule would be no more complicated than #home #messaging ul li a. Even if that weren't the case I could still just attach an id to the UL and be done with it.

An Alernative to Negative Text Indent for Image Replacement - CSS

I've never been a fan of the negative text indent trick for image replacement. Don't get me wrong, it's a great technique and is very useful, I've just never liked it. Something about setting those crazy negative indents always struck me as incredibly hacky (even though it really isn't,) so I never fully felt comfortable with the technique. I can't really explain it, but that's the reality.

Anyway, today I was looking at implementing an image replaced H1 on a site I'm developing and somehow, some way I was struck by a tiny bolt of inspiration and realized that, as long as my browser targets were reasonable (Firefox, IE6+, Safari, Opera 9+), I could use opacity to get the same result. That, for whatever reason, seemed like a better solution to me, so I went ahead and tried it. This post is the result…

If you want to see an example- like Madge said, you're soaking in it. I implemented it here tonight. I walk on the wild side.

Here's the markup for the image replaced <h2>*:

<h2 id="logo" ><a href="/" title="home">DrunkenFist.com</a></h2>

Here's the css in my main sheet:

#logo{
position:absolute;
width:629px;
height:147px;
z-index:1;
left: 0px;
top: -4px;
background-image: url(/img/logo.gif);
}
#logo a {
display:block;
width:200px;
height:50px;
opacity:0;
background:transparent;
}

The interesting bits are the opacity and background definitions. Opacity:0, should be pretty self explanatory. It sets the opacity of the anchor tag to 0. That's what hides the text. Opacity is supported by Firefox, Opera 9.0 (the Wii is covered) and Safari. I've not gone to town researching how far back Firefox and Safari support go, but I've seen it work in 1.* versions of both, so I'm pretty comfortable with support there. Setting the background to transparent was necessary to make the entire block clickable. Before I set that the only clickable area was where the invisible text was. If you've ever done any Flash development, it was like turning text into a button and neglecting to set a proper hit area. I'm not really sure why that was the case. I'd like to take some time to play around with variations to maybe see what's what.

As these things inevitably go, it was necessary to set some IE specific styles to make this work in Microsoft's pride and joy. Here's that markup as it's implemented now**


<!--[if gte IE 5.5]>
<style type="text/css">
#logo a {
filter:Alpha(opacity=0);
background:url();
}
</style>
<![if lt IE 7]>
<link rel="STYLESHEET" type="text/css" href="/css/ie.css" />
<![endif]>
<![endif]–>

Again, there are two interesting bits (maybe three if you're not familiar with conditional comments. Conditional comments rule the school.) The first is the IE specific filter:alpha(Opacity=0), which is the equivalent*** of the straightforward opacity definition used above. The second is the best I can do IE-wise to set a transparent background since IE doesn't support transparent as a value. There's got to be a better way to do that, but it's not coming to me at present (any suggestions?)

And that's it. I'm a little bit insane right now from hurriedly typing this thing out in the last hour and a half, so I'm sure I'll look at this in the morning and want to rework it, but until then, this will have to do.

*I use an H2 for this and not an H1 since:

  • I already get top placement for both my name and my domain name, so stuffing an H1 with either isn't really going to give me any real benefit and using anything else doesn't really make sense if I actually want to use the H2 as a home link for PDAs and text/voice browsers
  • I like using H1s for the topic of the page. Even if I'll never get top placement for "Movies" it just makes semantic sense for me to have that be the top of the content tree
  • My logo (and menus) are at the very bottom of my markup (this is more readily apparent in the markup of my main site, which starts almost immediately at the H1), so stuffing an H1 down at the bottom just feels plain wrong to me…

**I have to clean this up and get the styles out of the document. It's templated, so including the styles on a document by document basis is easy, I just hate obvious loose ends like this (especially since there are so many loose ends around here.) I just haven't had any instances where I had IE specific code that needed to run on IE7 as well as IE6, so I didn't have an elegant solution for such an eventuality.

**It should be noted that Opacity and the Alpha:filter aren't exactly equivalent as they use two separate scales. Since 0=0, it doesn't really matter what those differences are for the purposes of this article. When it's not so late and I'm not so tired, I'll write up a little bit on cross-brower Opacity.

Emptying the web junk drawer of my mind

(all apologies to, I believe, Bob Ryan, for stealing the title of this post)

The new A List Apart article, Switchy McLayout: An Adaptive Layout Technique, got me thinking about methods to serve content to mobile browsers. To play around with that in a real world environment (without having to wait around for a client to ask) I started to think seriously about how I want to handle serving content for mobile browsers here at Drunkenfist.com. The above article is nice in concept (especially since it works on the other end of the spectrum), but it doesn't do anything to limit the overall file sizes (in fact I imagine it adds to the size of the style sheets) or how much/what type of content is sent to the browsers. What I really want is a low overhead scheme for serving proper mobile friendly pages.

After thinking about it for a little bit, what I'm thinking about is setting up a sub-domain (mobile.drunkenfist.com) overlaying the main drunkenfist.com content and then using the URL as a test in my template files for whether or not to serve up certain content (only serving a single mobile sheet, serving alternative ads, no footer, no images, etc.)

In addition to that, I would use JS on my regular pages to redirect to the sub-domain based on screen resolution- one of the things I hate about mobile browsing is when sites that have a mobile version don't detect that I'm on a small screen and point me to it (I'm looking at you Yahoo.)

Thinking about it, I'm betting I could work something out in a day or two.

Of course there are a lot of variables involved here- finding the time to mess around with this being one and not breaking the regular version of my site being another…

Ajax Performance » Circumventing browser connection limits for fun and profit

I got this link from Ajaxian. It talks about using sub-domains to increase the number of practical connections available to a browser. Yet another thing I might mess around with here.

Here's a "handsome" chart outlining the slow and steady weekly growth of IE7 here at Drunkenfist.com. It's still slow as hell, but nearly 20% is a definite improvement.

chart.jpg

Here are the actual numbers (Google docs is awesome)

Speaking of Iframes, I'm working on a project that uses a hidden iframe instead of the XMLHttp Request object to get data from the server and I discovered something absolutely bizarre about the way that IE calculates the DOM in a situation where there is raw XML held as the content of a hidden iframe. If there's not a blank style sheet attached, IE rewrites the XML document as a series of DIVS and SPANS, completely obliterating the structure. Attach a dummy style sheet and everything is fine and dandy.

I made it work in FireFox and then switched over to smashing at it in IE. Nothing worked off the bat so I set about doing some discovery. Right off the bat I was getting results from getElementsByTagName that made no sense. I would do xmlObject.getElementsByTagName("*").length and get some totally off the wall result (50-something instead of the 10 or 12 I was expecting). That was driving me crazy since I could tell it was an object; I could tell it had structure (since it had tags to return); but I wasn't seeing the structure I expected. When I viewed the DOM using the IE developer toolbar I saw this:

bizarro.gif

After googling around for a few minutes, I came across some mention of using a dummy style sheet to get this to work in IE. I tried it out and immediately the app started behaving the way I expected. I'm curious whether or not this issue is resolved in IE7 (I'll find out soon enough as this app will have to work in Microsoft's latest and greatest)

I Worked On This:

I didn't actually build anything on this site, but in the couple of weeks I did work on it I did do some XML/XSLT work on the CMS part, a wee bit of JavaScript and mashed the CSS up to work correctly with the IE family.

This Is Cable - Cable Services And Providers

I wouldn't call LABEL obscure.


Since I try to use use one whenever I put together a form. Beyond the accessibility issues, I also use it as a layout hook, which is useful.

I also use the heck out of definition lists and use the optgroup from time to time. The rest of them, I'm mostly familiar with from at least reading about them.

Of course, I'm an HTML nerd, so that might explain all of the above.

ObscureTags.com — a museum of strange and rarely used HTML tags

Oral-B Stages Discover the Magic of Disney

I built this thing too.

I didn't design it or anything. I just made it work.

I made this.

Duracell Revenge of the Mummy Instant Win Game

I made this

Duracell Racing

Another site I built.