# form width is not 100% in embedded webpage

**URL:** <https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114>\
**Category:** CMS Development\
**Created:** [October 14, 2022, 8:21am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114 "2022-10-14T08:21:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadow42](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shadow42/32/49879_2.png) [@shadow42](https://community.hubspot.com/u/shadow42)\
**Post date:** [October 14, 2022, 8:21am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/1 "2022-10-14T08:21:29Z")

</div>

Hi,  
I created a form and embedded it in a webpage but despite of not changing any value all of a sudden the form, it is coming in half of the page like someone added col-6 (bootstrap) to it

my form setting:

 ![shadow42_1-1665735518175.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7ec0a1536d652699abba36381bdcaba9ed460d73.png)

my imbedded code:

 ![shadow42_3-1665735625558.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/3/83bb46579c2b61dc912946bdc28c99ad4789b372.jpeg)

I found one class that is giving the form its property width despite of mentioning 100% in the form style setting.

 ![shadow42_0-1665743492800.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/f/fa7a9a173ff52c907951328f51e729dc9b501a30.png)

any idea what am i doing wrong and how to avoid it?

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 14, 2022, 8:49am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/2 "2022-10-14T08:49:31Z")

</div>

Hey [@](https://community.hubspot.com/t5/user/viewprofilepage/user-id/379041)[shadow42](https://community.hubspot.com/t5/user/viewprofilepage/user-id/315565)

Could you please share the web page URL so that I can help you in a better way

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![shadow42](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shadow42/32/49879_2.png) [@shadow42](https://community.hubspot.com/u/shadow42)\
**Post date:** [October 17, 2022, 4:15am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/3 "2022-10-17T04:15:52Z")

</div>

> **[Smart Math Olympiad for Kids: Boost Their Skills and Confidence](https://www.98thpercentile.com/smart-math-olympiad)**
>
> Join the Smart Math Olympiad, the ultimate math competition for kids. Boost their problem-solving skills and prepare them for success with our fun and challenging questions.

here is the link

---

<div class="post-metadata">

**Author:** ![shadow42](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shadow42/32/49879_2.png) [@shadow42](https://community.hubspot.com/u/shadow42)\
**Post date:** [October 17, 2022, 4:17am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/4 "2022-10-17T04:17:28Z")

</div>

earlier it used to come in the style given in form but it recently happened.  
in early form i can see iframe coming but in the form where the style is not coming no iframe is there

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 17, 2022, 9:17am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/5 "2022-10-17T09:17:24Z")

</div>

Hey [@](https://community.hubspot.com/t5/user/viewprofilepage/user-id/379041)[shadow42](https://community.hubspot.com/t5/user/viewprofilepage/user-id/315565)

Place this code in JavaScript part of Hero banner’s module:

$(document).ready(function(){

$(‘#sm-full-register fieldset.form-columns-2’).css({‘max-width’: ‘100%’});

});

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [October 14, 2022, 8:23pm UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/6 "2022-10-14T20:23:12Z")

</div>

Hi @shadow42,

You could [modify the form embed code](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options). You have several approaches you can go.

**1. Disable the default HubSpot form styling completel** y so the form will be styled by the external CSS(it has to contain form styling). To achieve this simply add

`css: ""`

to the embed code.

In the end it should look like this

```lia-code-sample
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
 hbspt.forms.create({
 region: "na1",
 portalId: "xxxxxxx",
 formId: "xxxxxxxxxx",
 version: "V2_PRERELEASE",
 css: ""
 });
</script>

```

By doing so there won’t be loaded any styling which was applied in the form settings(you could also just hit the toggle box to render the form as raw HTML in the settings)

**2. add custom CSS classes** with

`cssClass: "myCustomClass"`

the embed code should look like this

```lia-code-sample
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
 hbspt.forms.create({
 region: "na1",
 portalId: "xxxxxxx",
 formId: "xxxxxxxxxx",
 version: "V2_PRERELEASE",
 cssClass: "myCustomClass"
 });
</script>

```

**3. Modify your CSS file** and apply some additional form stylings.

As far as I can tell the fieldset is set to a max-width of 500px.

Add

```lia-code-sample
fieldset{
max-width:100%;
}

```

to your CSS. I recommend either at the very bottom of your theme-override.css or forms.css(if you have one). If this shouldn’t work, try the good old sledgehammer called “!important” 😁

best,

Anton

---

<div class="post-metadata">

**Author:** ![shadow42](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shadow42/32/49879_2.png) [@shadow42](https://community.hubspot.com/u/shadow42)\
**Post date:** [October 17, 2022, 4:17am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/7 "2022-10-17T04:17:49Z")

</div>

then all styles that I am sending from the HubSpot form will go, right?  
I don’t want to do that, especially the responsive part it would take a long time for me to write the responsive part for the form and I don’t want that.  
earlier it used to come in the style given in form but it recently happened.  
in the early form, I can see iframe coming but in the form where the style is not coming no iframe is there

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [October 17, 2022, 9:46am UTC](https://community.hubspot.com/t/form-width-is-not-100-in-embedded-webpage/67114/8 "2022-10-17T09:46:25Z")

</div>

Hi @shadow42,

let’s sa:yes and no.

If you disable the HubSpot styling it won’t load the styling - correct. But it’s recommended to implement the final form styling on the page you’re embedding the form in. So My approach/suggestion would be:

Load the form without styling, and paste your form styling in the CSS of the external page. It’s more reliable and can be a bit faster in terms of page speed.

Regarding the sudden change of form styling: I can only assume that there are changes made by HubSpot since there might be an update coming soon(or there was an update). Experienced some different style loadings last week on a HubSpot page I’m currently working on. Page load 1: Custom styling; Page load 2: HubSpot default styling.

best,

Anton
