applying correct css to correct element