My issue is as follows: I've got a navigation bar with main navigation and some of these links have additional drop down menus. I'm trying to change the styling of the main link, whenever I hover over the drop down menu. I can't use classes as it will change the style of all the main nav links. Which means I can't use the following method
.dropdown:hover ~ .main{
change css here
}
I also can't use individual IDs for the linked drop down and main nav as it appears on too many pages already.
The format of the HTML is as follows
<a class="main-link">Main Link</a>
<div class="drop-down"></div>
My question is; is there a way to change the style of an element which appears directly before an element within a HTML document?