Paul Irish

Making the www great

Bookmarklet: Inject New Css Rules

I love doing as much CSS debugging as I can without hitting reload. (see also: my ‘refresh css’ bookmarklet)

newcssrule.PNGFirebug can get you a far way in playing with styles. You can edit current css rules and add new styles to a given element, but there is no way to add a brand new rule to the page. UNTIL NOW!!!

Drag this bad boy to your bookmark bar:

Update (2009.02.06):

This will work in all browsers (ie6+,ff,saf,chrome). [Source here]

>>> newcssrule <<<

The code is obviously trivial, but it’s a helpful button to have around sometimes. Plus you can then edit those rules in firebug immediately.

For full compatibility, understand the landscape at InstallStyles on Google Doctype.