VOOZH about

URL: https://www.geeksforgeeks.org/css/how-to-change-the-checked-mark-color-of-a-checkbox-using-css/

⇱ How to Change the Checked Mark Color of a Checkbox using CSS? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Change the Checked Mark Color of a Checkbox using CSS?

Last Updated : 23 Jul, 2025

Checkboxes are commonly used on websites to enable users to make selections, such as agreeing to terms and conditions or choosing preferences. A checkbox is a small square box in forms that users can click to select or deselect an option. By default, the checkmark inside the checkbox has a basic style, which may not match your site's design.

How to Change the Checkbox Checked Mark Color

Below are some common methods that can be used to change the checkbox mark color:

1. Using appearance: none

The easiest way to change the checkbox appearance is by removing the default style using the appearance property in CSS.

Now, let us understand with the help of the example:

Output

πŸ‘ checkbox
How to Change the Checked Mark Color of a Checkbox using CSS?

2. Using Pseudo-Elements

A common approach is to make a custom checkbox and its checked mark by hiding the normal checkbox and using the ::before and ::after pseudo-elements. This gives us complete control over how the checked and unchecked status look.

Now, let us understand with the help of the example:

Output

πŸ‘ Screenshot-2024-10-16-130759
How to Change the Checked Mark Color of a Checkbox using CSS?

3. Using CSS accent-color Property

This property allows you to pick a single color that will be applied to the background of the checkbox, the checked mark, and other parts of the form control.

Now, let us understand with the help of the example:

Output

πŸ‘ Screenshot-2024-10-16-130913
How to Change the Checked Mark Color of a Checkbox using CSS?

4. Using a Custom Background Image for the Checkbox

For a more unique and personalized checkbox design, a custom background image can be applied to the checked mark, allowing for greater flexibility and customization beyond the default styles.

Now, let us understand with the help of the example:

Output

πŸ‘ chnage-checkbox
How to Change the Checked Mark Color of a Checkbox using CSS?

5. Using box-shadow for the Check Mark

To change the color of the checked mark without fully redesigning the checkbox, the box-shadow property can be used to create a simple and subtle effect.

Now, let us understand with the help of the example:

Output

πŸ‘ Screenshot-2025-04-29-152258
How to Change the Checked Mark Color of a Checkbox using CSS?

Conclusion

Checkboxes are crucial for user selections on websites, but their default appearance may not fit the site’s design. By using CSS techniques like appearance: none, pseudo-elements, the accent-color property, custom background images, and box-shadow, the checkbox and its checked mark can be easily customized to match the site's style and improve the user experience.

Comment
Article Tags: