I display some events with current date and how many days left. The first span of days-left has opacity 0. I want when I hover on the second span (tour-date) then change opacity 1 for the first span (days-left).
I can solve this with eventlistener or jQuery but before I do it I want to know if there option with 2-3 lines in the CSS.
.days-left {
position: absolute;
left: 21%;
background-color: black;
height: 3%;
color: white;
border-radius: 10%;
font-weight: bold;
opacity: 1;
}
.tour-row :nth-child(2):hover> :nth-child(1) {
opacity: 0;
}
<div className="tour-row">
<span className='days-left'>{`daysLeft : ${currentTourInArray.daysLeft}`}</span>
<span className="tour-item tour-date ">{currentTourInArray.date}</span>
<span className="tour-item tour-city">{currentTourInArray.city}</span>
<span className="tour-item tour-arena">{currentTourInArray.arena}</span>
</div>