# Wrap fields in div tag

**URL:** <https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503>\
**Category:** Get Help\
**Tags:** feature-request, css\
**Created:** [November 20, 2024, 5:25pm UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503 "2024-11-20T17:25:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tracysurf](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/tracysurf/32/15825_2.png) [@tracysurf](https://community.gravityforms.com/u/tracysurf)\
**Post date:** [November 20, 2024, 5:25pm UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503/1 "2024-11-20T17:25:45Z")

</div>

I’m looking for a way to wrap multiple fields in a div tag.

The HTML block is automatically adding a closing `</div>`. So adding an open div for the value `<div class="border">` renders `<div class="border"></div>`.

_A feature request would be an HTML block option to display without a div wrapper._

The goal is to improve form appearance (e.g., borders around multiple fields) and add CSS breakpoints to improve responsiveness.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [November 22, 2024, 2:01am UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503/2 "2024-11-22T02:01:26Z")

</div>

Hello. The best place to submit product feedback, suggestions, and feature requests is via the [submit idea form on the roadmap page](https://www.gravityforms.com/gravity-forms-roadmap/?c=submit-idea). Those submissions go directly to the product management team. Thank you.

---

<div class="post-metadata">

**Author:** ![tracysurf](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/tracysurf/32/15825_2.png) [@tracysurf](https://community.gravityforms.com/u/tracysurf)\
**Post date:** [November 22, 2024, 2:19am UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503/3 "2024-11-22T02:19:31Z")

</div>

Ugh, that feature request was a thought, and I shouldn’t have mentioned it because it took the conversation away from the actual issue. BTW - I already properly submitted that request earlier.

Back to the issue - is there a way to wrap multiple fields in a div tag?

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [November 22, 2024, 2:28am UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503/4 "2024-11-22T02:28:20Z")

</div>

Gravity Forms used to not correct the invalid HTML, so you could have the opening div in one HTML field, and a closing div in another, and style everything within that div, but validation was added at some point and open divs will be closed, so that hack no longer works.

The closest I know of to this is Collapsible Sections from JetSloth:

> **[Gravity Forms Collapsible Sections](https://jetsloth.com/wordpress-plugins/gravity-forms-collapsible-sections/)**
>
> Long forms are notorious for bad conversions, Collapsible Sections will convert your forms into beautifully displayed, easy to use, conversion generators.

It allows you to specify whether a Gravity Forms Section field should be the Open or Close of a section. I know the collapsible part is not what you’re looking for, but their approach could be replicated with some custom code.

I don’t know of any other methods to do this without custom code.

---

<div class="post-metadata">

**Author:** ![tracysurf](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/tracysurf/32/15825_2.png) [@tracysurf](https://community.gravityforms.com/u/tracysurf)\
**Post date:** [November 22, 2024, 2:30am UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503/5 "2024-11-22T02:30:51Z")

</div>

Thanks Chris. I’m checking it out. Appreciate your time.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [November 22, 2024, 3:34am UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503/6 "2024-11-22T03:34:24Z")

</div>

There’s an article here that covers some of this:

> **[Gravity forms field groups](https://gravityranger.com/gravity-forms-field-groups/)**
>
> Gravity Forms field groups how to create them using three different methods. With and without add-ons.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [November 23, 2024, 3:34am UTC](https://community.gravityforms.com/t/wrap-fields-in-div-tag/18503/7 "2024-11-23T03:34:48Z")

</div>

Closed on November 23, 2024, 3:34am UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
