CMS Development

AJCourt
Membro

Using custom CSS

resolver

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 Avaliação positiva
1 Solução aceita
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Using custom CSS

resolver

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.

Exibir solução no post original

1 Resposta 1
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Using custom CSS

resolver

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.