# Editable styles for nested for loop

**URL:** <https://community.hubspot.com/t/editable-styles-for-nested-for-loop/91254>\
**Category:** CMS Development\
**Tags:** free\
**Created:** [October 6, 2023, 6:17am UTC](https://community.hubspot.com/t/editable-styles-for-nested-for-loop/91254 "2023-10-06T06:17:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NSangam](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@NSangam](https://community.hubspot.com/u/NSangam)\
**Post date:** [October 6, 2023, 6:17am UTC](https://community.hubspot.com/t/editable-styles-for-nested-for-loop/91254/1 "2023-10-06T06:17:04Z")

</div>

How can I style nested for loop which must editable. I have added this code but it is not taking the parent repeater class. Is this the right way?

Code -

\<div class=“whole”\>

\<div class=“card”\>  
\<h1\>{{ module.card.title }} \</h1\>  
{% for item in module.card.heading\_column %}  
\<div class=“heading-wrap heading-wrap-{{ loop.index }}”\>  
\<h3\>  
{{ item.heading }}  
\</h3\>  
{% for item2 in item.sub\_heading\_repeater %}  
\<div class=“sub-heading sub-heading-{{ loop.index }}”\>  
\<h5\>  
{{ item2.sub\_heading }}  
\</h5\>

\</div\>  
{% endfor %}  
\</div\>  
{% endfor %}  
\</div\>  
\</div\>

{% require\_css %}  
\<style\>  
{% scope\_css %}  
{% for item in module.card.heading\_column %}  
.heading-wrap-{{ loop.index }}  
{% for item2 in item.sub\_heading\_repeater %}  
.sub-heading-{{ loop.index }} h5{  
color: {{ item2.sub\_heading\_color.color }};  
}  
{% endfor %}  
}  
{% endfor %}

{% end\_scope\_css %}  
\</style\>  
{% end\_require\_css %}
