CMS Development

RElouahabi
Mitglied

Custom CSS for form

hi there, I created a form and embedded it on a webflow page. is there a way to add custom CSS to it to fix its styling?  here is a loom: https://www.loom.com/share/bfa83456ce93470eade3df3ebd42971d

0 Upvotes
1 Antwort
Anton
Trendsetter/-in | Diamond Partner
Trendsetter/-in | Diamond Partner

Custom CSS for form

Hi @RElouahabi

 

you can disable the default HubSpot styling by adding "css: ''" to the embed code.
it should look like this: 

original embed code(example):

 

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
	region: "na1",
	portalId: "XXXXXXX",
	formId: "XXX-XXX-XXX"
});
</script>

 

modified embed code:

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
	region: "na1",
	portalId: "XXXXXXX",
	formId: "XXX-XXX-XXX",
        css:''
});
</script>

 

After that you should be able to style it the way you like via CSS. 

 

 

best, 

Anton

Anton Bujanowski Signature