Skip to content

Instantly share code, notes, and snippets.

@yhs0602
Created August 4, 2020 06:46
Show Gist options
  • Save yhs0602/7a4d69fd36c4776dd85223a0c0c5bea3 to your computer and use it in GitHub Desktop.
Save yhs0602/7a4d69fd36c4776dd85223a0c0c5bea3 to your computer and use it in GitHub Desktop.
Relative hover
<div class="box"> 1 </div>
<div class="box2"> 2 </div>
<div class="box"> 3 </div>
.box {
position: relative;
width: 100px;
height: 100px;
background: blue;
margin: 10px;
}
.box2 {
position:relative;
width: 100px;
height: 100px;
background: tomato;
margin: 10px;
bottom: 50px;
left: 250px;
}
.box2:hover {
background: green;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment