Nested category navigation
You'll need to use the {% nav %} tag to output nested &lt;ul&gt;s as documented here:
https://craftcms.com/guides/displaying-a-navigation-for-a-structure-section

{% set categories = craft.categories.group('projectType').all() %}
{% nav category in categories %}
  {% if category.level == 1 %}
    &lt;h3 class="h5"&gt;&lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;&lt;/h3&gt;
  {% else %}
  &lt;li&gt;&lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;&lt;/li&gt;
  {% endif %}
  {% ifchildren %}
    &lt;ul class="unstyled"&gt;
      {% children %}
    &lt;/ul&gt;
  {% endifchildren %}
{% endnav %}


This answer should help too:
https://craftcms.stackexchange.com/a/4453