Category Archives: The Web

IE7’s CSS breaking “content: counter” bug

I came across a peculiar bug today while testing theiconic.com.au in IE7;

#foo:before {
    content: counter(item, ".") ": ";
}

Completely breaks IE7’s CSS parser for the current .css file.

The fix, as explained in pragmar’s answer on SO, is to add a space after ‘item’. This is not the most optimal fix, and has the potential to break when minifying.

The fix is to remove the space between the comma and the open quote. This is also safe for minification:

#foo:before {
    /* Note removing the space after ',' fixes IE7's CSS parser */
    content: counter(item,".") ": ";
}

This only occurs when using a quoted counter list-style-type. Using ‘open-quote’, ‘close-quote’, etc, does not exhibit the bug.

Check out the example below for a practical demonstration across browsers.

Example: IE7’s CSS breaking content counter bug.

ie7-content-bug

Happy Coding!

Tagged , , ,

Inserting a function into all classes in a directory via Terminal

Or; Multi-line Search and Replace regular expression on the Command Line.

The situation

You have a single abstract class which is extended multiple times in 10 or 100 different classes throughout your codebase.

You’ve found a need for a new abstract method which all classes must now implement.

The problem

Who wants to manually insert that new code into all those classes!? (I don’t).

We need an automated way to do this
Continue reading

Tagged , , , , , , ,

Zend Framework Quickstart with MySQL

The Zend Framework Quickstart guide is a great place to start with the Framework, however it bases the example program on SQLite. As MySQL is the choice of the rest of the world (and even Zend’s own Stack installation), here is the Zend Framework Quickstart done with MySQL.

Continue reading

Tagged , , ,

Play Framework, Google App Engine, Java, and HTML5 Boilerplate

Getting started with a new project shouldn’t be hard.

But, it is.

We have so many different packages to consider and integrate into our development process that it can take quite some time to get setup before we can even start developing.

Here’s one combination of packages I find particularly useful, and will cover setting up here;

Continue reading

Tagged , , ,

Install a Play Framework module from source

The Play Framework provides a great flexible Module system whereby any stand-alone code can be separated entirely from your main application. There are a number of pre-build and ready to go modules available here.

What if you want to check one out from github or googlecode and use it from source? Unfortunately, the Play Framework documentation on this is very sparse, so here’s how:
Continue reading

Tagged , ,