I have 2 divs - I want the text of the first div to change when I hover over the second div.
My rule below seems to have no effect:
.ico-b:hover ~ .lab-marker::before {content: "Option -";}
Any ideas would be much appreciated.
.lab-marker {
height: 22px;
padding-left: 5px;
padding-right: 5px;
border: 1px solid black;
width: 12px;
margin: auto;
margin-bottom: 20px;
font-size: 14px;
opacity: 0.5;
font-weight: 400;
background-color: pink;
}
.ico-b { padding: 20px; background-color: yellow; }
.ico-b:hover ~ .lab-marker::before {content: "Option -";}
<div>
<div class="lab-marker">A</div>
<div class="ico-b">Hover over me</div>
</div>