Archive for ‘uncategorized’ category

Styling the number of an ordered list

I’m sure it’s possible, isn’t it? I’ve searched high and low and can’t seem to figure out if it can be done. Should be simple — and I’m hoping it is: Can the number that is generated by an ordered list be styled seperately from what is contained within the li tag with CSS?

For instance, I’d like to bold the number, but not what’s in the li. Giving font-weight: bold to the ol doesn’t do it. And giving font-weight: bold to the li tag just bolds the whole thing. I realize I could add a span in there, but that seems uneccesary.

Seems like a completely logical thing to do — give the number special treatment like bold or a different color or font size.

I’m waiting for someone to make me feel stupid. And hoping…

A Garden Apart

In an effort to help the CSS Zen Garden grow, I’ve submitted my own theme, and Dave Shea has kindly accepted and posted it. It was fun working on this — mostly because the structure was already there. You only need create your own CSS file.

While I didn’t set out to create it in an A List Apart style, it did turn out that way. Perhaps the stroked fonts…

Anyhow, I was inspired to contribute to the garden — it’s already a great resource to point people, and hopefully it continues to grow.

On a related note, there’s an interesting post regarding XBL and the Zen Garden over at Dave Hyatt’s blog. Dave even demonstrates in plain English a simple example using XBL and CSS. Looks interesting, although only supported by Mozilla. I’m still a fan of XSLT because it is more standardized — but realize its limitations.

Part of the comments to this post talk about the extra span tags throughout the Zen Garden’s XHTML. They are there so that the multitude of designers that work on it can have the utmost flexibility. Sure they’re not necessary — in fact I didn’t use many of them. But that’s not the point of the excercise.

CSS Zen Garden

Dave Shea’s CSS Zen Garden is a fantastic idea for several reasons. Like others have been saying today, it can and will hopefully be a place to direct people who doubt the ability of building a site with web standards and CSS that is also a pleasure to look at.

It can be done, and now there is “tranquil” place to do so. I especially like that he’s named it a Zen garden — a calm place to soothe the naysayers. I’m hoping to add something eventually, that is if I can come up with a design that’s worthy of being alongside what is already there.

The Libertines

Great: when you see a band live and it’s better than the record. No-so-great: when the live show doesn’t live up to the record. Unfortunately, when we went out last night and saw The Libertines, it was more of the latter. Their record is very excellent — old school Clash-esque punk, with little hidden melodies. But the show was a little too much on the sloppy side.

It was still nice to get out and see some music though.

Quick Bits

When I switched over to using titles on my entries here, rather than just a date, I lost the ability to post quick links to places where a long description wasn’t necessary. I miss posting just links to things that are interesting, funny or that speak for themselves, so I added a Kottke-esque “Quick Bits” area to the right column.

Here there’ll be just quick hits to stuff that I’ve found noteworthy. I still need to fix up the archive page for this, but the separate RSS feed should be working fine.

It still uses SimplePost — I just duplicated the whole thing and told it to deal with a single file, rather than multiple months.

More Props for CSS

Yikes, it seems there’s been some anti-CSS talk recently. Simon Willison defends it in an intelligent way. Key points that I agree with are below:

Less Code. It’s easy to understand that a CSS layout takes far fewer lines of code than a nested table one. CSS is read once and then cached (which can be annoying at times). Less code means, faster downloads and a smaller footprint. It saves money, people. Just ask, who recently went CSS on their homepage, saving a gazillion terrabytes or something in bandwidth (I’m too lazy to dig up the link where this is quoted), or what we’ve just done with Fast Company — where page load has proven to decrease dramatically.

Accessibility. It’s a fact that coding with structure in mind will make the content of pages more accessible. People can easily read in text and speech readers as well as all browsers. They might not get the design details — but they will be able to read the darn thing. And isn’t that what counts the most?

CSS isn’t all that hard. It’s true. Too many are giving up because CSS doesn’t solve all of their problems easily. All it takes is a little reading. Just like it did to learn HTML — and the payoff is much greater. A lot of the anti-CSS rants I’ve been reading sound like they come from someone that does not really want to give much effort into learning it. Sure there are browser quirks. But getting around those quirks isn’t impossible.

Tables are not evil. Yes, you read correctly. Tables are perfectly fine — it’s about separating presentational markup from structural markup. When you separate, you get all sorts of benefits. Use tables for what they were designed for. Heck use them to layout a basic framework, then use CSS to handle the rest. It doesn’t have to be one way or the other. In fact, use what’s best depending on the project. Just don’t bash a technology that can improve things for everyone.


Validation and the target Attribute

So the target attribute is not allowed within hyperlinks in XHTML 1.0 Strict. There’s a workaround using DOM and JavaScript (via a post on What Do I Know).

It’s stuff like this (throwing out a perfectly fine attribute, that is both dead-simple and easy to implement) that keeps me away from Strict. Using target to open links in a new (or named) window is sometimes necessary — even if you don’t believe it should ever be done from a user’s perspective. Content management systems and other web-based tools often depend on this, and complicating an elementary task such as this one will just keep more developers from adopting the Strict document type. My two cents.

12 oz. Just Ain’t Enough

A 12 oz. can of soda, juice, beer or any other beverage just doesn’t cut it. This is especially true when drinking the beverage with lunch. I should clarify that 12 oz. is just barely not enough. A 16 oz. bottle is a ridiculously large amount of liquid. Too much, in fact.

So. I’m proposing that someone starts marketing 14 oz. cans. It’s gotta be a can, and it’s gotta have that 2 more extra oz. It’ll be just enough to take that last sip after you’ve polished off that BLT.