Use "/404.css" as link, don't hardcode the full path. And still I can't say I like the general approach.