CMS Development

AJCourt
Member

Using custom CSS

SOLVE

Hi all,

 

New to HubSpot and I'm trying to style my first form with CSS local to my site.  I have 2 simple field forms - email address and submit button.

 

How do I find these using JQuery and change classes to style them?

I'm using bootstrap 5 on my web site.

Thanks

Andrew

 

0 Upvotes
1 Accepted solution
amwilie
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

Using custom CSS

SOLVE

You don't need to use jQuery. In the form editor go to the "Style & preview" tab and toggle on "Set as raw HTML form". This will remove any HubSpot styling and allow you to style them purely with CSS in your stylesheet. Here's an example stylesheet for styling HubSpot forms so you can see some of the classes used - https://github.com/HubSpot/cms-theme-boilerplate/blob/main/src/css/elements/_forms.css

 

Also, HubSpot uses just regular ol form elements so once set to raw HTML it'll take on any styling you already have set for form elements (as long as you're styling the elements themselves and not using custom classes instead).

If this answer solved your question, please mark it as the solution!

Alyssa Wilie

Web Developer at Lynton

explore hubspot themes from lynton

Need custom website/integration development or help optimizing HubSpot for your organization?
Schedule a consultation with us, an award-winning HubSpot Elite Partner.


Or check out our blog to get the latest in marketing, design, integration, and HubSpot knowledge.

 

View solution in original post

1 Reply 1
amwilie
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

Using custom CSS

SOLVE

You don't need to use jQuery. In the form editor go to the "Style & preview" tab and toggle on "Set as raw HTML form". This will remove any HubSpot styling and allow you to style them purely with CSS in your stylesheet. Here's an example stylesheet for styling HubSpot forms so you can see some of the classes used - https://github.com/HubSpot/cms-theme-boilerplate/blob/main/src/css/elements/_forms.css

 

Also, HubSpot uses just regular ol form elements so once set to raw HTML it'll take on any styling you already have set for form elements (as long as you're styling the elements themselves and not using custom classes instead).

If this answer solved your question, please mark it as the solution!

Alyssa Wilie

Web Developer at Lynton

explore hubspot themes from lynton

Need custom website/integration development or help optimizing HubSpot for your organization?
Schedule a consultation with us, an award-winning HubSpot Elite Partner.


Or check out our blog to get the latest in marketing, design, integration, and HubSpot knowledge.