Accent-Color css property (input, progress)
We can use accent-color to color the form parts we use input and progress. We can use accent-color to color selectable boxes, writable text, markable places.
It is a Accent-Color property that we can use to color the interiors of different UI controls.
<!DOCTYPE html>
<html>
<head>
<style>
input[type=checkbox] {
accent-color: blue;
}
input[type=radio] {
accent color: pink;
}
input[type=range] {
accent-color: rgb(24, 24, 255);
}
progress {
accent-color: hsl(15, 100%, 50%);
}
</style>
</head>
<body>
<h1>The accent-color Property</h1>
<h3>Accent color for checkboxes:</h3>
<input type="checkbox" id="vehicle1" name="vehicle1" value="Plane" checked>
<label for="vehicle1"> I have a plane</label><br>
<input type="checkbox" id="vehicle2" name="vehicle2" value="Home" checked>
<label for="vehicle2"> I have a home</label><br><br>
<h3>Accent color for radiobuttons:</h3>
<input type="radio" id="html" name="fav_language" value="HTML">
<label for="html">HTML</label><br>
<input type="radio" id="css" name="fav_language" value="CSS" checked>
<label for="css">CSS</label><br>
<h3>Accent color for a range field:</h3>
<label for="vol">Volume:</label>
<input type="range" id="vol" name="vol" min="0" max="50">
<h3>Accent color for a progress element:</h3>
<label for="file">Downloading progress:</label>
<progress id="file" value="33" max="100"> 33% </progress>
</body>
</html>
The labels we use The accent-color property are; <progress>, <input type="radio">, <input type="range">, <input type="checkbox">.
Css <style> codes;
progress {
accent-color: hsl(39, 100%, 50%);
}
input[type=checkbox] {
accent-color: blue;
}
input[type=range] {
accent-color: rgb(22, 22, 255);
}
input[type=radio] {
accent-color: pink;
}
JavaScript syntax: object.style.accentColor="blue"