Jump to content

[Share] Form Error Message CSS

Recommended Posts

Some CSS code to adjust form block error message style. You can use code to Website Tools > Custom CSS.

#1. Error Message color

/* Error message color */
p.form-field-error {
    background-color: #f1f !important;
    color: #000;
}
p.form-field-error svg path {
    fill: #000 !important;
}

image.png.4ec60e737dc423b180f73115aede6366.png

#2. Error text size

/* error text size */
p.form-field-error {
    font-size: 30px;
    letter-spacing: 1px;
}
p.form-field-error svg {
    width: 30px;
    height: 30px;
}

image.png.5d4d5d8141c6042882d10628ae55666d.png

#3. Change Error icon

Replace Pixabay with new icon url.

/* error icon */
p.form-field-error svg {
    display: none;
}
p.form-field-error:before {
    content: "";
    display: inline-block;
    width: 50px;
    height: 50px;
    background-image: url(https://cdn.pixabay.com/photo/2023/10/18/15/30/statue-8324499_1280.jpg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
}

image.png.8d19f7c580567290cea6d2e92cf04ad6.png

#4. Error message font

Replace monospace with your font. You can follow below guide to get exact font-family name

/* Error font */
p.form-field-error {
    font-family: monospace;
}

image.png.d6af35f21d34c2d554e3d3f88224dd78.png

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • Replies 0
  • Views 635
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.