I have DIV 1 and DIV 2. In the code Div 2 is located after Div 1. I want to change the background colour of Div 1 when Div 2 is hovered. Preferebly I do not want to change the HTML structure and do not want to use JS.
div {
background-color: yellow;
padding: 20px;
display: none;
}
span:hover div {
display: block;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>I will show on hover</div>
<span>Hover over me!</span>
</body>
</html>
Thanks in advance.