Well, you didn't tell us anything about 'css' or how this is failing. My guess though is you actually want something like this:
while (list($tag,$rest) = each($GLOBALS['css'])) {
print($tag . " {\n");
while (list($property, $value) = each($rest)) {
print(tab() . $property . ": " . $value . ";\n");
}
print("}\n");
}
Tell us a bit more about what is happening and the contents of 'css' and maybe we can help...