# How do you remove the excess space in a FieldSet

**URL:** <https://forum.radzen.com/t/how-do-you-remove-the-excess-space-in-a-fieldset/8538>\
**Category:** Radzen.Blazor Components\
**Created:** [July 21, 2021, 10:58pm UTC](https://forum.radzen.com/t/how-do-you-remove-the-excess-space-in-a-fieldset/8538 "2021-07-21T22:58:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rik](https://forum.radzen.com/letter_avatar_proxy/v4/letter/r/90db22/32.png) [@rik](https://forum.radzen.com/u/rik)\
**Post date:** [July 21, 2021, 10:58pm UTC](https://forum.radzen.com/t/how-do-you-remove-the-excess-space-in-a-fieldset/8538/1 "2021-07-21T22:58:26Z")

</div>

How would I remove the excess space between the FieldSet component's outline and the child text within?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 22, 2021, 3:16am UTC](https://forum.radzen.com/t/how-do-you-remove-the-excess-space-in-a-fieldset/8538/2 "2021-07-22T03:16:53Z")

</div>

You can do that with CSS. Use your browser element inspector to check which class should be modified.

---

<div class="post-metadata">

**Author:** ![mj-it](https://forum.radzen.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mj-it](https://forum.radzen.com/u/mj-it)\
**Post date:** [March 6, 2025, 11:17am UTC](https://forum.radzen.com/t/how-do-you-remove-the-excess-space-in-a-fieldset/8538/3 "2025-03-06T11:17:21Z")

</div>

> [@rik](#):
>
> How would I remove the excess space between the FieldSet component's outline and the child text within?

how did you solved it?  
i tried this in the page.razor.css, but didnt worked:

```auto
.rz-fieldset-legend{
  margin-bottom: 0;
}

```

---

<div class="post-metadata">

**Author:** ![browe](https://forum.radzen.com/user_avatar/forum.radzen.com/browe/32/21909_2.png) [@browe](https://forum.radzen.com/u/browe)\
**Post date:** [September 27, 2025, 4:36pm UTC](https://forum.radzen.com/t/how-do-you-remove-the-excess-space-in-a-fieldset/8538/4 "2025-09-27T16:36:48Z")

</div>

There are several different elements that I had to address to make this do what I wanted. I had to go globally on mine to make it do what was needed. The rz-expander-content, rz-fieldset-content and the rz-fieldset-legend got the spacing taken care of for me. Not sure how to handle the rz-expander-content on an as needed basis though.

```auto
/* Global Fieldset Stylization*/
.rz-fieldset {
    background-color: #f8f8ff !important;
    border: 1px solid #a3a3ff !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
}  
.rz-expander-content,    
.rz-fieldset-content {
    padding-top: 0px !important;
    padding-right: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    padding-left: 0.5rem !important;
}
    .rz-fieldset legend {
       margin-bottom: 0 !important;
        
    }
    .rz-fieldset content-wrapper {
        padding: 0 !important;
        margin: 0.25rem !important;
    }

```

---

<div class="post-metadata">

**Author:** ![Kathy](https://forum.radzen.com/letter_avatar_proxy/v4/letter/k/13edae/32.png) [@Kathy](https://forum.radzen.com/u/Kathy)\
**Post date:** [October 13, 2026, 6:11pm UTC](https://forum.radzen.com/t/how-do-you-remove-the-excess-space-in-a-fieldset/8538/5 "2026-10-13T18:11:52Z")

</div>

Gemini suggested the following when asked for an “in-page” solution to avoid having to change general style-sheets.

```html
<style>
    #tight-fieldset .rz-fieldset-content {
        padding: 0px !important; /* put your preferred padding here */
    }
</style>
<!-- further down on the same page -->
<div id="tight-fieldset">    
   <RadzenFieldset ...>
   </RadzenFieldset>
</div>

```

It might _not_ be proper HTML because of the placement of the Style tag, but it worked on both Chrome and Edge when I tested. Thus, use with caution.
