I am working on a thermometer design that features multiple segments and a circle at the start. When hovering over each segment, I want it to highlight along with the circle. Currently, the issue is that the first segment is created using two overlapping divs, resulting in an unintended effect when hovered over.
Is there a way to modify the CSS code to ensure that both the first segment and the circle light up simultaneously when either one is hovered over? Ideally, I would like a solution within CSS, but I am open to using JavaScript or jQuery if necessary. Below is the current HTML and CSS:
<div class="thermo">
<div class="startthermo"> </div>
<div class="thermopadding"> </div>
<div class="thermalcapsule" style="width: 10%">
<div class="thermal thermal1">1</div>
100
</div>
<div class="thermalcapsule" style="width: 15%">
<div class="thermal thermal2">2</div>
200
</div>
<!-- More HTML here -->
</div>
.thermo {
width: 95%;
margin-left: auto;
margin-right: auto;
}
.thermalcapsule {
margin-right: 1px;
margin-top: 20px;
float:left;
text-align: center;
cursor: pointer;
position: relative;
z-index: 1;
}
.thermalcapsule:hover .thermal1{
background-color: #000000;
}
.thermoimage {
margin-left: -15px;
margin-top: 8px;
float: left;
}
.thermopadding {
width: 2%;
float:left;
}
.startthermo {
width: 50px;
height: 50px;
border-radius: 50px;
background-color: #60A4CE;
border: 9px solid #f4f4f4;
display: block;
float:left;
position: absolute;
}
.thermal {
width: 100%;
padding: 5px;
text-align: center;
color: #fff;
font-weight: bold;
position: relative;
z-index : 5;
}
.thermal1 {
background-color: #60A4CE;
}
.thermal2 {
background-color: #437C87;
}