html - CSS hover doesn't work -


I am quite new to HTML and CSS and I know that this is probably a very dumb question, but I try I am doing this for a while and solve it and I do not know what is wrong.

I want a div to change its backgound color, when the mouse will enter another element which is not related to it (when it is the child of the second component, it works fine) .

My HTML:

  & lt ;; Doctype html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "style.css" & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; NAV & gt; & Lt; / Neo & gt; & Lt; Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

and CSS:

  * {margin: 0 pixels; Padding: 0 pixels; } NAV {Width: 100%; Height: 50px; Background color: black; } Div {width: 100%; Height: 40px; Background color: green; Status: Completed; Left: 500 pounds; } Nav: hover divis (background color: blue;}   

I tried to change the "nav: hover div" rule for something like "nav: hover body"

Use + :

  nav: hover + div {background color: blue;}   

< Strong>

The rule you tried, nav: hover div , was looking for divs of NAV You wanted Brothers.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -