Archive for December, 2006

Happy Birthday, CSS!

Wednesday, December 20th, 2006

First of all, sorry that I haven’t posted in a long while. It’s been a big crunch at work, but we’ve cranked out a Brand new homepage. I’m planning on writing up a few articles about the development process and architecture behind it in the few days.

Anyway, this week we celebrate CSS10: Ten Year Anniversary of Cascading Style Sheets (CSS). It’s been 10 big years since CSS debuted. I remember the good old days, when I first started building websites. CSS wasn’t supported at all. Everything used the font tag and its many glorious attributes. If you wanted a background color, you used bgcolor. Margin only worked sporadically on certain elements. In most cases, if it wasn’t a table it wasn’t working.

Now, I only use CSS and can’t remember most of those decprecated properties that I used to rely on to make anything look halfway decent. Tables are back to where they belong, holding data. Here’s to 10 more!

technorati tags:, , ,

Who likes lists?

Tuesday, December 5th, 2006

Positioning lists (ul and ol in HTML-speak) can generally be a huge pain: Mozilla FireFox and Internet Explorer (7, 6, 5 …) both treat lists and list items different: they have different padding, different margins, basically entirely different rendering, and, to top it all off, the list-item-image or list-item-type receive different treatment.

Here’s my "best of all possible solutions" to getting the li portions of your lists to play nicely together. Basically, using a n Internet Explorer conditional comment, give your list items list-style-position:inside and give whatever’s inside your list some padding or text-indent. This won’t get your lists to work the same cross-browser. However, it will let you remove a lot of the extra margin and padding that IE crowds into your list items, making them a little easier to work with. This goes especially true if you’re trying to squeeze them into a tight position.

technorati tags:, , , , ,

CSS Selector Classes on an ID

Tuesday, December 5th, 2006

Want to add a combination of ID and class to a selector? Here’s a nice little piece of CSS. Let’s say you have code like this:

Hello world!

If you want to write a selector based on that element having both that ID and class name in combination (for an even tighter degree of specificity), you can write that selector like so:

div#foo.bar

That CSS selector will match your element. Again, the format is element#id.class.

technorati tags:, , , ,

How to Set Up IE 6 and IE7 on the Same Machine

Monday, December 4th, 2006

Hot on the heels of the download is the tutorial.

technorati tags:, , ,

The Power of method_missing

Sunday, December 3rd, 2006

Ruby’s method_missing (which essentially provides a rescue hook for any calls to methods that are missing - not defined) comes in pretty handy with Rails. (Now, I’m no Ruby on Rails guru, so take the following with a grain of salt, but I found it pretty effective.

Every URL maps to a controller then a view (after your URL, it’s /controller/view). What if a user tries to go to a view that’s not there? Say you have a controller called “foo” that has a view mapped to “bar.” /foo/bar works just fine. But if a user types in /foo/baz, you’re in a little bit of trouble. Here’s where method missing comes in: in your application.rb file, just add a declaration for method_missing and have method_missing take care of things for you by redirecting or otherwise re-routing that bad request. Here’s an example:

def method_missing(url)
  redirect_to :controller => "foo", :action => "bar"
end

Any errant method calls (read: any attempts to visit a controller action that doesn’t exist) is now safely handled: you’ve essentially intercepted that phony URL in application.rb and handled it as gracefully as possible. You can redirect, render a special template, or anything else you’d like. A really, really neat trick!

technorati tags:, , , ,

IE 6 and IE 7 on the same PC … for free!

Saturday, December 2nd, 2006

Microsoft has offered up something to all of us looking for an easy way to develop sites in both IE 6 and IE 7 from the same machine. From their blog:

Microsoft has recently made Virtual PC 2004 a free download; we’ve taken advantage of that by releasing a VPC virtual machine image containing a pre-activated Windows XP SP2, IE6 and the IE7 Readiness Toolkit to help facilitate your testing and development.

IEBlog : IE6 and IE7 Running on a Single Machine

What also looks promising is their mention of "we’re also investigating creating other VPC images, for example IE5, IE5.5, IE6 and IE6 SP1, as well as versions of IE on different language operating systems." This is a great way to test the extreme backwards compatibility that you often need to take into account when developing for large corporate bases, or smaller businesses, who, as audiences, may very well be locked into a certain browser – no matter how outdated – for business IT reasons. MS may very well let us test that old version of IE5.5 that only the very few still use (and, by the way, people ARE still using it, as a look at my employer’s logs show me).

This certainly beats my current cross-browser-version development platform: using Remote Desktop to connect to a second box on my desk running IE7 (and FF 2.0).

technorati tags:, , ,

I'm Reading…
Search This Site
You are currently browsing the A Modern Fable weblog archives for December, 2006.

AddThis Feed Button

Need great hosting?

Categories