skip to Main Content

I have a script code for my forms, but I’m not sure how to change the font color and font family of the span (labels for the forms)

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script> 
<script>
hbspt.forms.create({
region: "na1",
portalId: "40139212",
formId: "758ff855-f664-4297-81d7-ea647222454a"
});
</script>

I had no prior knowledge on javascript, this was just a copy-paste code given to me.

2

Answers


  1. I’m not entirely familiar with your question, but every form will create a form tag in the DOM. So, why would you need to style this tag with CSS?

    Example:

    #your_form_id{
      span{
        font-color: xxx;
        font-family: xxx;
      }
    }
    
    Login or Signup to reply.
  2. You can either use an external stylesheet or you can apply CSS styles directly to those elements.

    In your case it could be something like this

    <style>
    
    .hs-form label{
    color:#333 /*Change to whatever coilor you want*/
    font-family: Arial, sans-serif
    
    }
    
    </style>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search