# Overwriting Form CSS

**URL:** <https://community.hubspot.com/t/overwriting-form-css/19939>\
**Category:** CMS Development\
**Tags:** css\
**Created:** [April 8, 2020, 3:52pm UTC](https://community.hubspot.com/t/overwriting-form-css/19939 "2020-04-08T15:52:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![christinacschne](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/christinacschne/32/98942_2.png) [@christinacschne](https://community.hubspot.com/u/christinacschne)\
**Post date:** [April 8, 2020, 3:52pm UTC](https://community.hubspot.com/t/overwriting-form-css/19939/1 "2020-04-08T15:52:19Z")

</div>

Hi All,  
I feel like this should be an easy and simple fix but I’ve had no luck overwriting the padding around this button on a form.  
URL: [https://info.comporium.com/business-expansion-phase-4-charlotte](https://info.comporium.com/business-expansion-phase-4-charlotte)  
Code I added to the page in the \<head\> but had no luck getting it to overwrite.  
.form-container .hs\_submit .hs-button {  
margin-top: 0px!important;  
margin-bottom: 0px!important;  
padding: 0px!important;  
}

 ![Screen Shot 2020-04-08 at 11.42.02 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/3/438f319e78bdf374e9f52517771c3e3dd489c065.png)

Appreciate your thoughts!

---

<div class="post-metadata">

**Author:** ![david\_eic](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/david_eic/32/6864_2.png) [@david\_eic](https://community.hubspot.com/u/david_eic)\
**Post date:** [April 9, 2020, 10:37am UTC](https://community.hubspot.com/t/overwriting-form-css/19939/2 "2020-04-09T10:37:18Z")

</div>

Hi Christina,

Try this CSS

```auto
.hs-form-fef1d6cd-eda0-4be3-ad57-b193851bf810_67ea71a7-ba88-4c66-b509-448df8c4fc4d .hs-submit > .actions {
margin-top: 0;
margin-bottom: 0;
padding: 0;
}

```

I think your issue is your CSS is targeting the wrong element.

Let me know if this helps,

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![christinacschne](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/christinacschne/32/98942_2.png) [@christinacschne](https://community.hubspot.com/u/christinacschne)\
**Post date:** [April 9, 2020, 2:09pm UTC](https://community.hubspot.com/t/overwriting-form-css/19939/3 "2020-04-09T14:09:49Z")

</div>

I added the code but it didn’t overwrite. I also tried adding !important to the css and still nothing. Do you have any other thoughts?

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [April 10, 2020, 2:16pm UTC](https://community.hubspot.com/t/overwriting-form-css/19939/4 "2020-04-10T14:16:48Z")

</div>

@christinacschne if you are using the iframe embed, you will not be able to override the styles from outside of the iframe. I believe you can edit the form and click on “Style & preview” tab then turn on the “Set as raw HTML form” toggle and it should now let you style it with CSS as it will no longer display in an iFrame.

---

<div class="post-metadata">

**Author:** ![christinacschne](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/christinacschne/32/98942_2.png) [@christinacschne](https://community.hubspot.com/u/christinacschne)\
**Post date:** [April 13, 2020, 3:10pm UTC](https://community.hubspot.com/t/overwriting-form-css/19939/5 "2020-04-13T15:10:28Z")

</div>

Ah, got it! Thank you.  
I didn’t understand the embedding the iframe won’t allow for overriding styles. Thanks. I will edit the raw HTML form them.

---

<div class="post-metadata">

**Author:** ![Aimeegraham](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Aimeegraham](https://community.hubspot.com/u/Aimeegraham)\
**Post date:** [August 14, 2024, 5:45pm UTC](https://community.hubspot.com/t/overwriting-form-css/19939/6 "2024-08-14T17:45:21Z")

</div>

It would make everyones lives a lot easier if the button could be more customizeable. Do you have a link to all of the preset style CSS fields somewhere so we don’t have to start from scratch on the RAW HTML.
