Answer the question
In order to leave comments, you need to log in
How to make two neighboring tags interact with each other?
There are two adjacent blocks, is it possible to make the body respond when hovering over the navigation block using CSS?
<main>
<nav></nav>
<section></section>
</main>
nav
width: 50px
position: fixed
top: 0
bottom: 0
left: 0
background: #151515
nav:hover
width: 150px
section
position: fixed
top: 0
right: 0
bottom: 0
left: 70px
background: #151515
nav:hover section
left: 170px
Answer the question
In order to leave comments, you need to log in
You probably need to use "+":
nav:hover + section
left: 170px
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question