# Custom Form Styling Issue

**URL:** <https://community.hubspot.com/t/custom-form-styling-issue/106104>\
**Category:** CMS Development\
**Tags:** css, javascript, forms\
**Created:** [April 30, 2024, 10:49am UTC](https://community.hubspot.com/t/custom-form-styling-issue/106104 "2024-04-30T10:49:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![10D\_JB](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/10d_jb/32/202488_2.png) [@10D\_JB](https://community.hubspot.com/u/10D_JB)\
**Post date:** [April 30, 2024, 10:49am UTC](https://community.hubspot.com/t/custom-form-styling-issue/106104/1 "2024-04-30T10:49:01Z")

</div>

Hopefully this is the correct channel to post this:  
I am having issues getting the cssClass attribute to output on a form I am trying to embed into a WordPress website.

I am creating the embed as a custom Gutenberg block, and whilst the form/block does output on the page, no styling I try seems to work when editing the CSS (compiled in the theme via webpack), nor does the custom class get added to the form HTML.

See below, I am trying to add the class ‘newsletter’ as defined in the script, as per the instructions [here](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options), I do note the URL subdomain is ‘legacydocs’ so wondering if this method might no longer be possible?

HTML:

```lia-code-sample
<script charset="utf-8" type="text/javascript" src="//js-eu1.hsforms.net/forms/embed/v2.js"></script>
 <script>
 hbspt.forms.create({
 region: "eu1",
 portalId: "25254412",
 formId: "8e1e9666-d23e-42a8-a127-12ce1a7101f5",
 cssClass: 'newsletter',
 css: '',
 cssRequired: ''
 });
 </script>

```

CSS:

/\* test CSS \*/

.hs-form.newsletter .hs-form\_\_virality-link {

display: none;

}

.hs-form.newsletter .hs-button {

background-color: blue;

}

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [April 30, 2024, 10:34pm UTC](https://community.hubspot.com/t/custom-form-styling-issue/106104/2 "2024-04-30T22:34:47Z")

</div>

Hey, [@10D\_JB](https://community.hubspot.com/t5/user/viewprofilepage/user-id/753927) 👋 The Legacy docs are stable and supported unless explicitly flagged for depreciation.

Questions:

— Does your portal have a Marketing Hub Professional or Enterprise or a Content Hub Professional or Enterprise subscription? (required)

— Is your form set to [Raw HTML](https://knowledge.hubspot.com/forms/how-can-i-share-a-hubspot-form-if-im-using-an-external-site#with-css-in-your-external-stylesheet-marketing-hub-professional-enterprise-or-legacy-marketing-hub-basic-only:~:text=Set%20as%20raw%20HTML%20form)?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![10D\_JB](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/10d_jb/32/202488_2.png) [@10D\_JB](https://community.hubspot.com/u/10D_JB)\
**Post date:** [May 1, 2024, 8:35am UTC](https://community.hubspot.com/t/custom-form-styling-issue/106104/3 "2024-05-01T08:35:07Z")

</div>

Thanks for the reply - I had a feeling that might be the case, I don’t have the permissions on our account to see that but I think its the free version. I have seen the raw HTML option but it is locked for me so that must indicate that’s the case.

I got the impression from the docs that this used to be possible with the free version so that’s a shame, looks like it’s back to the drawing board!
