If this has been asked before I sincerely apologize. After around half an hour of searching I cannot seem to find one "best answer," and most solutions I have come across seem to involve JavaScript. While I am not totally opposed to JavaScript - HTML, CSS, and PHP are definitely my stronger skillsets. If this cannot be done without using JavaScript, I will probably need some serious baby talk. Here's my question:
I would like to change the background image of an one element as the hover state of an entirely separate element. Here is an example of how I would like this to work:
.some_element:hover {
#some_unrelated_div {
background-image: url('path/to/img.jpg');
}
}
I hope that conveys a clear enough message of my ideal solution. Thanks guys.
parentselector, so it's going to be VERY difficult. In short, this is a problem requiring a Javascript solution. Luckily for you, a dash of jQuery and 3 lines of code will do the trick.#some_unrelated_divis actuallyrelatedi.e. is a child of .some_element and inherits the background from it.