How can I change the hover and background color of checkboxes in Webflow without having to set every checkbox to custom? I've tried adding custom code to the project settings but haven't been able to change the background color. Any suggestions? Thank you!

TL;DR
  • Add custom CSS in Webflow Project Settings to globally style checkboxes for hover and background color changes.
  • Publish and test the site to ensure the new styles are applied, adjusting CSS as needed.

You want to change the hover and background color of checkboxes in Webflow without customizing each individually. This process involves leveraging custom code in a way that is applied globally across your project.

1. Use Custom CSS for Global Style

  • Go to Project Settings and navigate to the Custom Code section.
  • Add the following CSS in the Head Code section for styling the checkboxes:

<style>
  input[type="checkbox"]:hover {
    background-color: #d1d1d1; /* Change this value to your desired hover color */
  }
  input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    background-color: #fff; /* Initial background color */
    border: 2px solid #000; /* Border color */
    cursor: pointer;
  }
  input[type="checkbox"]:checked {
    background-color: #5cb85c; /* Checked background color */
  }
</style>

  • Save the changes and publish your site for the styles to take effect.

2. Test Your Changes

  • Publish the site and test your checkboxes to ensure the new styles are applied.
  • Adjust the CSS properties as necessary for finer control over the appearance.

Summary

By adding global CSS in the Webflow Project Settings, you can change the hover and background color of checkboxes without having to set each individually. Adjust the CSS properties in the custom code to fit the design of your site.

Rate this answer

Other Webflow Questions