Adding active class to category link
If you're using the nav on an entries page, this is how you'd do that:

You can check if an ElementCriteriaModel with the following criteria returns anything using the length filter. The ID of the entries must match your current entry's ID and they must be related to the currently looped category.

&lt;li&gt;
    {% set activeClass = craft.entries.id(entry.id).relatedTo(category)|length ? 'active' %}
    &lt;a href="{{ category.url }}" class="{{ activeClass }}"&gt;{{ category.title }}&lt;/a&gt;
&lt;/li&gt;