diff --git a/templates/dataset/forum-list.html.twig b/templates/dataset/forum-list.html.twig
index 2d537faa27dadcbaaf487a450718ab0e3c91952e..ed7bd703a5fae6ea3b5f95d549ee5fda2752a1ad 100644
--- a/templates/dataset/forum-list.html.twig
+++ b/templates/dataset/forum-list.html.twig
@@ -60,7 +60,7 @@
           {% if forum.description.value %}
             <div class="forum__description">{{ forum.description.value }}</div>
           {% endif %}
-          {% if forum.depth > 0 %}{% for i in 1..forum.depth %}</div>{% endfor %}{% endif %}
+        {% if forum.depth > 0 %}{% for i in 1..forum.depth %}</div>{% endfor %}{% endif %}
       </td>
       {% if forum.is_container == false %}
         <td class="forum__topics">
diff --git a/templates/layout/book-export-html.html.twig b/templates/layout/book-export-html.html.twig
index 86bb37ed225ef26154b554f46ec76ea2e45dfe32..42877535853d455760db55d8456a6f8633d94ade 100644
--- a/templates/layout/book-export-html.html.twig
+++ b/templates/layout/book-export-html.html.twig
@@ -34,12 +34,17 @@
       to be exported as printer-friendly HTML.
     #}
 
-  {% if depth > 1 %}{% for i in 1..depth-1 %}
-    <div>
-  {% endfor %}{% endif %}
+  {% if depth > 1 %}
+    {% for i in 1..depth-1  %}
+      <div class="section-{{ i }}">
+    {% endfor %}
+  {% endif %}
   {{ contents }}
-  {% if depth > 1 %}{% for i in 1..depth-1 %}
-    </div>
-  {% endfor %}{% endif %}
+  {% if depth > 1 %}
+    {% for i in 1..depth-1 %}
+      </div>
+    {% endfor %}
+  {% endif %}
+
   </body>
 </html>