Open In App

CSS accent-color Property

The accent-color property in CSS specifies the color of user interface elements/controls like checkboxes, radio buttons, range, and progress elements. 

Syntax:



accent-color: auto|<color>|initial|inherit;

Property Value: 

Example 1: The following code demonstrates the accent-color property of CSS.






<!DOCTYPE html>
<html lang="en">
  
<head>
    <title>CSS accent-color Property</title>
  
    <style>
        h1 {
            color: green;
        }
  
        input {
            width: 30px;
            height: 30px;
        }
  
        .accent {
            accent-color: red;
        }
    </style>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
  
        <h3>CSS accent-color Property</h3>
  
        <input type="checkbox" name="">
        <input type="checkbox" name="" class="accent">
  
        <input type="radio" name="">
        <input type="radio" name="" class="accent">
    </center>
</body>
  
</html>

Output:

 

Example 2:




<!DOCTYPE html>
<html lang="en">
  
<head>
    <title>CSS accent-color Property</title>
  
    <style>
        h1 {
            color: green;
        }
  
        .accent {
            accent-color: red;
        }
  
        input,
        progress {
            width: 300px;
        }
    </style>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
  
        <h3>CSS accent-color Property</h3>
  
        <input type="range" name="">
        <br>
        <input type="range" name="" class="accent">
        <br>
  
        <progress>Abc</progress>
        <br>
        <progress class="accent">Abc</progress>
    </center>
</body>
  
</html>

Output:

 

Supported Browsers:


Article Tags :