Looking for a way to style a list of buttons with the same shape and size but different colors? The buttons have unique IDs and all belong to the same class. Take a look at the code snippet below:
--html snippet
<ul id="query_type">
<li class="round-button" id="create">C</li>
<li class="round-button" id="read">R</li>
<li class="round-button" id="update">U</li>
<li class="round-button" id="delete">D</li>
</ul>
-css file
.round-button {
width: 10%;
height: 0;
padding-bottom: 10%;
border-radius: 50%;
border: 2px solid #f5f5f5;
overflow: hidden;
background: #464646;
box-shadow: 0 0 3px gray;
}
.round-button:hover {
background: #262626;
}
Wondering how to change the background color of each button based on its ID? Explore ways to override the background property of .round-button for individual IDs.