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
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | 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 Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

View solution in original post

1 Reply 1
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | 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 Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.