Edit the color of the error messages of a form

SOLVE
Regular Contributor

Hello, I hope somebody can give me some advice. Can anybody tell me how I can edit the color of the error message of a form. Now hardly it can be detinguished from the general text. Can I do this by editing the CSS of the form only? Thanks so much. Best regards, Petra

1 Accepted solution

Accepted Solutions
Regular Contributor

Thanks so much for your response. All the commands work except the color. I don´t know if I have some superior stylesheet which limits this. The code I have included in the CSS sheet. Thank you a lot and best regards,
Petraform2.PNGcode.PNG

Reply
0 Upvotes
12 Replies 12
Regular Advisor

Hi @petras

 

need to just add below CSS to some error list target class like,

ul.hs-error-msgs > li > label {
    font-size:12px;
    line-height:normal;
    display:block;
    color:red;
}

add this CSS Syntax in your CSS stylesheet.

 

Did my post help answer your query? Help the Community by marking it as a solution.

 

Team TRooInbound

Reply
0 Upvotes
Regular Contributor

Thanks so much for your response. All the commands work except the color. I don´t know if I have some superior stylesheet which limits this. The code I have included in the CSS sheet. Thank you a lot and best regards,
Petraform2.PNGcode.PNG

Reply
0 Upvotes
New Contributor

You can try adding an "!important" tag to the property in case something is overriding it.

 

color: red !important;
Reply
0 Upvotes
Regular Advisor
ul.hs-error-msgs > li > label {
font-size:12px;
line-height:normal;
display:block;
color:red !important;
}

@petras
Replace code with above code

Did my post help answer your query? Help the Community by marking it as a solution.

Team TRooInbound

Regular Contributor

Thanks so much, your post did just exactly what it should do. Everything fine now. Have a nice day ahead. Petra

Reply
0 Upvotes
Regular Advisor

Hey @petras,

 

That's Cool! Cheers! 

 

Did my post help answer your query? Help the Community by marking it as a solution

 

Team TRooInbound

 

Reply
0 Upvotes
New Contributor

Hi Petras,

 

Unless the theme has some custom classes overriding the error messages, it should be pretty easy to customize the color of the texts.

 

All you have to do is add some custom styles to the page header. Something like this should do the trick –

 

<style>
  .hs-form-field .hs-error-msgs { color: red; }
</style>

Here's a quick GIF of how to do that.

 

c8rMkc.gif

 

Hope this helps. If you have any more troubles fixing the styles, feel free to reach out to me at hi@sellmx.com and I can help you out, no charge!

Reply
0 Upvotes
New Contributor

Hello Friends, 

 

I tried above code and it's not working for me, can anyone help pls?

 

https://wardpeter.com/SD_New/contact-us

Reply
0 Upvotes
Regular Advisor

Hi @cyberlobe 

I show on your page,

try this code

.hs-error-msgs label {
    color: #f2545b !important;
}
Reply
0 Upvotes
New Contributor

I tried that its not working

Reply
0 Upvotes
Highlighted
Regular Contributor

I also have this problem but maybe in a different situation. I use the HubSpot forms not with the HS CMS but with WordPress. My forms sit on a dark orange WordPress theme and no one can see the error messages because they are red. I am on Marketing Hub Starter and my understanding is that changing the stylesheet works only from Professional+

The theme is, of course, complicated and I have no idea how to change the style of the theme. I need a solution for styling the form itself so error message text is black.

Reply
0 Upvotes
New Contributor

I'm having this issue as well and none of the above solutions work. I really want to avoid custom coding a form because the rest of my team cannot code.

Reply
0 Upvotes