CSS for same level

css, css-selectors

Solution

Use the general sibling combinator

#yourId:hover ~ div
{
    color:red;
}

Also note that Id's must begin with a letter. W3 ID Attribute

Example

Problem

If I have 3 divs at the same level ( not one in another ) . How can I change the color of the other div when hover one without using IDs and classes. I would like somthing like : ``` <div id="1" ></div> <div></div> <div></div> ``` And CSS : ``` #1 :hover < body > div { //Here I change the things } ```

Original source