How to Change the Color of Radio Buttons and Checkboxes with accent-color in CSS
Browsers draw ticked checkboxes and selected radio buttons in their own color, a blue in Chromium. One CSS property, accent-color, changes that color to yours, with no custom drawing.
Syntax
<selector> {
accent-color: <color>;
}
| Part | What it does |
|---|---|
<selector> | The controls to color, such as input. |
<color> | The new accent color, such as #c50f1f. |
MDN's accent-color page lists the elements it applies to: checkboxes, radio buttons, range sliders and progress bars.
The Example
The example is a sign-up form with a ticked checkbox and two radio buttons. First you see the controls in the browser's own blue, then you add one rule that turns them red.
Step 1: Write the Code
Create a file named index.html in a text editor, such as Visual Studio Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>accent-color</title>
</head>
<body>
<p><label><input type="checkbox" checked> Email me the newsletter</label></p>
<p>
<label><input type="radio" name="plan" checked> Monthly</label>
<label><input type="radio" name="plan"> Yearly</label>
</p>
</body>
</html>
Step 2: Open It in a Browser
Double-click index.html. It opens in your browser:

The tick and the selected radio button are blue, Chromium's own accent color. The screenshot comes from Chromium 159, the open-source browser that Chrome is built on.
Step 3: Add accent-color
Add a style element with a rule for input to head, so the file looks like this:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>accent-color</title>
<style>
input {
accent-color: #c50f1f;
}
</style>
</head>
<body>
<p><label><input type="checkbox" checked> Email me the newsletter</label></p>
<p>
<label><input type="radio" name="plan" checked> Monthly</label>
<label><input type="radio" name="plan"> Yearly</label>
</p>
</body>
</html>
Step 4: Reload the Page
Save the file and reload the page in your browser:

What Happened
- The tick and the selected radio button turned red. Chromium gave the inputs the accent color
rgb(197, 15, 31), which is#c50f1f. - The unselected Yearly radio button kept its grey ring. The accent color shows on the ticked and selected parts of the controls.
- The labels didn't change color:
accent-coloronly touches the controls.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Using color | color sets the text color, so the checkbox stayed blue | Use accent-color |
| Expecting it to change text boxes or buttons | MDN lists only checkboxes, radio buttons, range sliders and progress bars | Style other fields with background, border and color |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The controls keep the browser's blue | The rule uses color, or its selector doesn't match the inputs | Use accent-color on a selector that matches them |
| The color works in one browser but not another | The other browser doesn't support accent-color | See the next question |
FAQ
Does accent-color work in every browser?
Not yet. MDN marks it as limited availability: it doesn't work in some of the most widely used browsers. A browser that doesn't support it ignores the rule, so the controls keep their default color and the form still works.
Conclusion
Set accent-color on your checkboxes and radio buttons, and the browser draws them in your color. It's one line, and in browsers without it, the controls simply keep their default look.
Additional Resources
- accent-color, on MDN.
